Skip to content

Commit cdc7f06

Browse files
feat: laravel 11.x compatibility (#1003)
* Bump dependencies for Laravel 11 * Update GitHub Actions for Laravel 11 * Update JsValidatorFactory.php --------- Co-authored-by: Kieran <[email protected]> Co-authored-by: Kieran <[email protected]>
1 parent 6eb7734 commit cdc7f06

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.github/workflows/php-tests.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ on:
99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
12+
1213
strategy:
1314
matrix:
14-
laravel: ['9', '10']
15+
laravel: ['9', '10', '11']
1516
php: ['8.1', '8.2', '8.3']
17+
exclude:
18+
- laravel: '11'
19+
php: '8.1'
1620

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

composer.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
],
2828
"require": {
2929
"php": "^8.0",
30-
"illuminate/config": "^9.0|^10.0",
31-
"illuminate/contracts": "^9.0|^10.0",
32-
"illuminate/http": "^9.0|^10.0",
33-
"illuminate/support": "^9.0|^10.0",
34-
"illuminate/translation": "^9.0|^10.0",
35-
"illuminate/validation": "^9.0|^10.0",
36-
"illuminate/view": "^9.0|^10.0",
37-
"symfony/http-foundation": "^6.0"
30+
"illuminate/config": "^9.0|^10.0|^11.0",
31+
"illuminate/contracts": "^9.0|^10.0|^11.0",
32+
"illuminate/http": "^9.0|^10.0|^11.0",
33+
"illuminate/support": "^9.0|^10.0|^11.0",
34+
"illuminate/translation": "^9.0|^10.0|^11.0",
35+
"illuminate/validation": "^9.0|^10.0|^11.0",
36+
"illuminate/view": "^9.0|^10.0|^11.0",
37+
"symfony/http-foundation": "^6.0|^7.0"
3838
},
3939
"require-dev": {
4040
"mockery/mockery": "^1.0",
41-
"orchestra/testbench": "^7.0|^8.0",
41+
"orchestra/testbench": "^7.0|^8.0|^9.0",
4242
"phpunit/phpunit": "^9.5|^10.0"
4343
},
4444
"autoload": {

src/JsValidatorFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ protected function createFormRequest($class)
221221
$request = $this->app->__get('request');
222222
$formRequest = $this->app->build($class, $params);
223223

224-
if ($session = $request->getSession()) {
224+
if ($request->hasSession() && $session = $request->session()) {
225225
$formRequest->setLaravelSession($session);
226226
}
227227
$formRequest->setUserResolver($request->getUserResolver());

0 commit comments

Comments
 (0)