Skip to content

Commit a4fff33

Browse files
committed
[Feature] Support Laravel 9
1 parent 9898574 commit a4fff33

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php: [ '7.4', '8.0', '8.1' ]
18-
laravel: [ '^8.76' ]
17+
php: [7.4, '8.0', 8.1]
18+
laravel: [8.76, 9]
19+
exclude:
20+
- php: 7.4
21+
laravel: 9
1922

2023
steps:
2124
- name: Checkout Code
@@ -31,14 +34,14 @@ jobs:
3134
ini-values: error_reporting=E_ALL
3235

3336
- name: Set Laravel Version
34-
run: composer require "laravel/framework:${{ matrix.laravel }}" --no-update -n
37+
run: composer require "laravel/framework:^${{ matrix.laravel }}" --no-update
3538

3639
- name: Install dependencies
3740
uses: nick-invision/retry@v1
3841
with:
3942
timeout_minutes: 5
4043
max_attempts: 5
41-
command: composer install --no-suggest --prefer-dist -n -o
44+
command: composer update --prefer-dist --no-interaction --no-progress
4245

4346
- name: Execute tests
4447
run: vendor/bin/phpunit

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. This projec
77

88
### Added
99

10+
- This package now supports Laravel 9.
1011
- This package now supports PHP 8.1.
1112

1213
### Changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"laravel-json-api/exceptions": "^1.1",
3232
"laravel-json-api/spec": "^1.1",
3333
"laravel-json-api/validation": "^2.0",
34-
"laravel/framework": "^8.76"
34+
"laravel/framework": "^8.76|^9.0"
3535
},
3636
"require-dev": {
3737
"cloudcreativity/json-api-testing": "^4.0",
3838
"laravel-json-api/testing": "^1.1",
39-
"orchestra/testbench": "^6.23",
39+
"orchestra/testbench": "^6.23|^7.0",
4040
"phpunit/phpunit": "^9.5.10"
4141
},
4242
"autoload": {

tests/dummy/app/JsonApi/V1/Posts/PostCollectionQuery.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public function rules(): array
4343
'array',
4444
JsonApiRule::filter(),
4545
],
46+
'filter.id' => ['array'],
47+
'filter.id.*' => ['integer'],
48+
'filter.published' => [JsonApiRule::boolean()->asString()],
49+
'filter.slug' => ['string'],
4650
'include' => [
4751
'nullable',
4852
'string',

tests/dummy/app/JsonApi/V1/Posts/PostQuery.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function rules(): array
4444
JsonApiRule::filter()->forget('id'),
4545
],
4646
'filter.published' => ['boolean'],
47+
'filter.slug' => ['string'],
4748
'include' => [
4849
'nullable',
4950
'string',

tests/dummy/tests/Api/V1/Posts/IndexTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ public function testFilteredAndPaginated(): void
216216
];
217217

218218
$response = $this
219-
->withoutExceptionHandling()
220219
->jsonApi()
221220
->expects('posts')
222221
->filter(['published' => 'true'])

0 commit comments

Comments
 (0)