Skip to content

Commit 7aec3d9

Browse files
committed
- Testing laravel 12 support
1 parent 058ca37 commit 7aec3d9

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

Diff for: .github/workflows/run-tests.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,19 @@ jobs:
1616
fail-fast: true
1717
matrix:
1818
os: [ ubuntu-latest ]
19-
php: [ 8.3, 8.2, 8.1 ]
20-
laravel: [ 11.*, 10.*, 9.* ]
19+
php: [ 8.4, 8.3, 8.2 ]
20+
laravel: [ 12.*, 11.*, 10.* ]
2121
stability: [ prefer-lowest, prefer-stable ]
2222
include:
23+
- laravel: 12.*
24+
testbench: 10.*
25+
carbon: ^3.8.4
2326
- laravel: 11.*
2427
testbench: 9.*
2528
carbon: ^2.63
2629
- laravel: 10.*
2730
testbench: 8.*
2831
carbon: ^2.63
29-
- laravel: 9.*
30-
testbench: 7.*
31-
carbon: ^2.63
32-
exclude:
33-
- laravel: 11.*
34-
php: 8.1
3532

3633
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
3734

Diff for: composer.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.1",
14-
"illuminate/support": "^9.0 || ^10.0 || ^11.0",
15-
"spatie/laravel-query-builder": "^5.7"
13+
"php": "^8.2",
14+
"illuminate/support": "^10.0 || ^11.0 || ^12.0",
15+
"spatie/laravel-query-builder": "^6.3"
1616
},
1717
"require-dev": {
18-
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0",
19-
"phpunit/phpunit": "^9.5 || ^10.5"
18+
"orchestra/testbench": "^8.0 || ^9.0 || ^10.0",
19+
"phpunit/phpunit": "^10.5 || ^11.5.3"
2020
},
2121
"autoload": {
2222
"psr-4": {
@@ -30,7 +30,7 @@
3030
},
3131
"extra": {
3232
"branch-alias": {
33-
"dev-main": "1.0-dev"
33+
"dev-main": "2.0-dev"
3434
},
3535
"laravel": {
3636
"providers": [

Diff for: src/QueryBuilder.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function ignoreInvalidFilters(): self
6060
/**
6161
* Validate filters conditionally
6262
*/
63-
protected function ensureAllFiltersExist()
63+
protected function ensureAllFiltersExist(): void
6464
{
6565
if (!$this->ignoreInvalidFilters) {
6666
parent::ensureAllFiltersExist();
@@ -72,7 +72,7 @@ protected function ensureAllFiltersExist()
7272
*
7373
* @param Collection $includes
7474
*/
75-
protected function addIncludesToQuery(Collection $includes)
75+
protected function addIncludesToQuery(Collection $includes): void
7676
{
7777
if (!$this->request->has('include')) {
7878
$includes = $this->allowedIncludes->map(function (AllowedInclude $allowedInclude) {
@@ -140,7 +140,7 @@ public function fieldsToAlwaysInclude($fields): self
140140
/**
141141
* Modified to support fields without table name
142142
*/
143-
protected function ensureAllFieldsExist()
143+
protected function ensureAllFieldsExist(): void
144144
{
145145
$modelTable = $this->getSubject()->getModel()->getTable();
146146

@@ -170,7 +170,7 @@ protected function ensureAllFieldsExist()
170170
*
171171
* @return array
172172
*/
173-
protected function getFieldAppends()
173+
protected function getFieldAppends(): array
174174
{
175175
$subjectTable = $this->getSubject()->getModel()->getTable();
176176

@@ -218,7 +218,7 @@ protected function retrieveFieldsToAppends(array $fields): array
218218
* @param Collection $results
219219
* @return Collection
220220
*/
221-
protected function addAppendsToResults(Collection $results)
221+
protected function addAppendsToResults(Collection $results): Collection
222222
{
223223
return $results->each(function (Model $result) {
224224
$to_append = $this->getAllAppends();
@@ -250,7 +250,7 @@ protected function getAllAppends(): array
250250
/**
251251
* Modified to support fields without table name
252252
*/
253-
protected function addRequestedModelFieldsToQuery()
253+
protected function addRequestedModelFieldsToQuery(): void
254254
{
255255
$modelTableName = $this->getModel()->getTable();
256256

Diff for: tests/TestCase.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public function setUp(): void
2020

2121
protected function getPackageProviders($app): array
2222
{
23-
return [QueryBuilderServiceProvider::class];
23+
return [
24+
\Spatie\QueryBuilder\QueryBuilderServiceProvider::class,
25+
QueryBuilderServiceProvider::class
26+
];
2427
}
2528
}

0 commit comments

Comments
 (0)