Skip to content

Commit

Permalink
feat: laravel 11.x compatibility (#1003)
Browse files Browse the repository at this point in the history
* Bump dependencies for Laravel 11

* Update GitHub Actions for Laravel 11

* Update JsValidatorFactory.php

---------

Co-authored-by: Kieran <kieran.brahney@gmail.com>
Co-authored-by: Kieran <kieran@supportpal.com>
  • Loading branch information
3 people committed Mar 13, 2024
1 parent 6eb7734 commit cdc7f06
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/php-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ on:
jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
laravel: ['9', '10']
laravel: ['9', '10', '11']
php: ['8.1', '8.2', '8.3']
exclude:
- laravel: '11'
php: '8.1'

name: PHP ${{ matrix.php }} Laravel ${{ matrix.laravel }}

Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
],
"require": {
"php": "^8.0",
"illuminate/config": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/http": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"illuminate/translation": "^9.0|^10.0",
"illuminate/validation": "^9.0|^10.0",
"illuminate/view": "^9.0|^10.0",
"symfony/http-foundation": "^6.0"
"illuminate/config": "^9.0|^10.0|^11.0",
"illuminate/contracts": "^9.0|^10.0|^11.0",
"illuminate/http": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0",
"illuminate/translation": "^9.0|^10.0|^11.0",
"illuminate/validation": "^9.0|^10.0|^11.0",
"illuminate/view": "^9.0|^10.0|^11.0",
"symfony/http-foundation": "^6.0|^7.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"orchestra/testbench": "^7.0|^8.0",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.5|^10.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion src/JsValidatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ protected function createFormRequest($class)
$request = $this->app->__get('request');
$formRequest = $this->app->build($class, $params);

if ($session = $request->getSession()) {
if ($request->hasSession() && $session = $request->session()) {
$formRequest->setLaravelSession($session);
}
$formRequest->setUserResolver($request->getUserResolver());
Expand Down

0 comments on commit cdc7f06

Please sign in to comment.