Skip to content

Commit cb91018

Browse files
committed
feat: support Laravel 11 & 12
Upgrades package dependency requirements to allow installation in Laravel 11 & 12 environments. This also addresses some newer phpstan issues, where phpstan knows about specific types now.
1 parent 3286f44 commit cb91018

File tree

9 files changed

+31
-22
lines changed

9 files changed

+31
-22
lines changed

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
steps:
1616
- name: Checkout code
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
with:
1919
ref: ${{ github.head_ref }}
2020

.github/workflows/phpstan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
name: phpstan
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
- name: Setup PHP
1717
uses: shivammathur/setup-php@v2
1818
with:
19-
php-version: '8.1'
19+
php-version: '8.3'
2020
coverage: none
2121

2222
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest]
16-
php: [8.3, 8.2, 8.1]
17-
laravel: [10.*]
16+
php: [8.3, 8.2]
17+
laravel: [10.*, 11.*, 12.*]
1818
stability: [prefer-stable]
1919
include:
2020
- laravel: 10.*
2121
testbench: 8.*
2222
carbon: ^2.63
23+
- laravel: 11.*
24+
testbench: 9.*
25+
carbon: ^2.63
26+
- laravel: 12.*
27+
testbench: 10.*
28+
carbon: ^3.0
2329

2430
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2531

@@ -39,7 +45,7 @@ jobs:
3945
4046
steps:
4147
- name: Checkout code
42-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4349

4450
- name: Setup PHP
4551
uses: shivammathur/setup-php@v2

.github/workflows/update-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
steps:
1515
- name: Checkout code
16-
uses: actions/checkout@v3
16+
uses: actions/checkout@v4
1717
with:
1818
ref: main
1919

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ All notable changes to `ag-grid-laravel` will be documented in this file.
44

55
## Unreleased
66

7+
- Added support for Laravel 11 & 12
78
- Added support for nested relations in filters
89
- Added support for set values handling
910

11+
## 0.2.1 (2023-10-5)
12+
13+
- Fixed double query for resource classes
14+
1015
## 0.2.0 (2023-08-24)
1116

12-
- Rename `$params` to `$filters` in `AgGridCustomFilterable`
17+
- Rename `$params` to `$filters` in `AgGridCustomFilterable`
1318

1419
## 0.1.0 (2023-08-24)
1520

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121
}
2222
],
2323
"require": {
24-
"php": "^8.1",
25-
"illuminate/contracts": "^10.0",
24+
"php": "^8.1|^8.2|^8.3|^8.4",
25+
"illuminate/contracts": "^10.0|^11.0|^12.0",
2626
"maatwebsite/excel": "^3.1",
2727
"spatie/laravel-package-tools": "^1.14.0"
2828
},
2929
"require-dev": {
3030
"laravel/pint": "^1.0",
31-
"nunomaduro/collision": "^7.8",
32-
"nunomaduro/larastan": "^2.0.1",
33-
"orchestra/testbench": "^8.8",
34-
"pestphp/pest": "^2.0",
35-
"pestphp/pest-plugin-arch": "^2.0",
36-
"pestphp/pest-plugin-laravel": "^2.0",
31+
"nunomaduro/collision": "^7.8|^8.1",
32+
"larastan/larastan": "^2.0.1|^3.0",
33+
"orchestra/testbench": "^8.8|^9.0|^10.0",
34+
"pestphp/pest": "^3.0",
35+
"pestphp/pest-plugin-arch": "^3.0",
36+
"pestphp/pest-plugin-laravel": "^3.0",
3737
"phpstan/extension-installer": "^1.1",
38-
"phpstan/phpstan-deprecation-rules": "^1.0",
39-
"phpstan/phpstan-phpunit": "^1.0"
38+
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
39+
"phpstan/phpstan-phpunit": "^1.0|^2.0"
4040
},
4141
"autoload": {
4242
"psr-4": {

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ parameters:
99
tmpDir: build/phpstan
1010
checkOctaneCompatibility: true
1111
checkModelProperties: true
12-
checkMissingIterableValueType: false
1312

src/AgGridQueryBuilder.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ public function toResponse($request): mixed
196196

197197
$clone = $this->clone();
198198
tap($clone->getQuery(), function (QueryBuilder $query) {
199-
/** @phpstan-ignore-next-line */
200199
$query->limit = $query->offset = $query->orders = null;
201200
$query->cleanBindings(['order']);
202201
});
@@ -421,7 +420,7 @@ protected function traverse($model, $key, $default = null): Model
421420
foreach (explode('.', $key) as $segment) {
422421
try {
423422
$model = $model->$segment;
424-
} catch (\Exception $e) { // @phpstan-ignore-line
423+
} catch (\Exception $e) {
425424
return value($default);
426425
}
427426
}

src/Support/Column.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(
3131
if ($hasPathAccessor) {
3232
$this->isJsonColumn = true;
3333
} else {
34-
$model = collect($this->relations)->last()?->model ?? $this->baseModel;
34+
$model = collect($this->relations)->last()->model ?? $this->baseModel;
3535
$colum = Str::before($this->name, '.');
3636

3737
$this->isJsonColumn = $model->hasCast($colum, [

0 commit comments

Comments
 (0)