Skip to content

Commit 64ad4d3

Browse files
freekmurzelaravel-shiftdrbyteclaude
authored
Add Laravel 13 support (#2923)
* Bump dependencies for Laravel 13 * Update GitHub Actions for Laravel 13 * Try ^13 instead of '13.0' * Modify testbench versions Updated testbench versions for Laravel matrix testing. * Match matrix strings * Add PHP 8.5 support, fix coverage warnings, ensure Pest 4/PHPUnit 12 * Update pest-plugin-laravel constraint and drop prefer-lowest - Allow pestphp/pest-plugin-laravel ^4.1 for Laravel 13 support - Drop prefer-lowest from CI matrix (causes failures with old testbench) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Allow laravel/passport ^13.0 for Laravel 13 compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Upgrade to laravel/passport ^13.0 and fix test setup Passport 13 changed the client schema (redirect_uris instead of redirect, grant_types instead of personal_access_client/password_client) and the passport:client command now requires --provider for personal clients. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Shift <shift@laravelshift.com> Co-authored-by: Chris Brown <code@drbyte.dev> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 53bc645 commit 64ad4d3

3 files changed

Lines changed: 22 additions & 16 deletions

File tree

.github/workflows/run-tests.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
name: "Run Tests - Current"
1+
name: Run Tests - Current
22

3-
on: [push, pull_request]
3+
on:
4+
- push
5+
- pull_request
46

57
jobs:
68
test:
7-
89
runs-on: ubuntu-latest
10+
911
strategy:
1012
fail-fast: false
1113
matrix:
1214
php: [8.5, 8.4, 8.3]
13-
laravel: ['^12']
14-
testbench: ['^10']
15-
dependency-version: [prefer-lowest, prefer-stable]
15+
laravel: ["^13", "^12"]
16+
dependency-version: [prefer-stable]
17+
include:
18+
- laravel: "^13"
19+
testbench: 11.*
20+
- laravel: "^12"
21+
testbench: 10.*
1622

1723
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
1824

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"homepage": "https://github.com/spatie/laravel-permission",
2424
"require": {
2525
"php": "^8.3",
26-
"illuminate/auth": "^12.0",
27-
"illuminate/container": "^12.0",
28-
"illuminate/contracts": "^12.0",
29-
"illuminate/database": "^12.0",
26+
"illuminate/auth": "^12.0|^13.0",
27+
"illuminate/container": "^12.0|^13.0",
28+
"illuminate/contracts": "^12.0|^13.0",
29+
"illuminate/database": "^12.0|^13.0",
3030
"spatie/laravel-package-tools": "^1.0"
3131
},
3232
"require-dev": {
3333
"larastan/larastan": "^3.9",
34-
"laravel/passport": "^12.0",
34+
"laravel/passport": "^13.0",
3535
"laravel/pint": "^1.0",
36-
"orchestra/testbench": "^10.0",
37-
"pestphp/pest": "^3.0",
38-
"pestphp/pest-plugin-laravel": "^3.0",
36+
"orchestra/testbench": "^10.0|^11.0",
37+
"pestphp/pest": "^3.0|^4.0",
38+
"pestphp/pest-plugin-laravel": "^3.0|^4.1",
3939
"phpstan/phpstan": "^2.1"
4040
},
4141
"minimum-stability": "dev",

tests/TestSupport/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ public function setUpPassport(): void
198198
// $this->artisan('passport:keys');
199199
$this->loadMigrationsFrom(__DIR__.'/../../vendor/laravel/passport/database/migrations/');
200200
$provider = in_array('users', array_keys(config('auth.providers'))) ? 'users' : null;
201-
$this->artisan('passport:client', ['--personal' => true, '--name' => config('app.name').' Personal Access Client']);
201+
$this->artisan('passport:client', ['--personal' => true, '--name' => config('app.name').' Personal Access Client', '--provider' => $provider]);
202202
$this->artisan('passport:client', ['--password' => true, '--name' => config('app.name').' Password Grant Client', '--provider' => $provider]);
203203

204-
$this->testClient = Client::create(['name' => 'Test', 'redirect' => 'https://example.com', 'personal_access_client' => 0, 'password_client' => 0, 'revoked' => 0]);
204+
$this->testClient = Client::create(['name' => 'Test', 'redirect_uris' => ['https://example.com'], 'grant_types' => [], 'revoked' => 0]);
205205
$this->testClientRole = $app[Role::class]->create(['name' => 'clientRole', 'guard_name' => 'api']);
206206
$this->testClientPermission = $app[Permission::class]->create(['name' => 'edit-posts', 'guard_name' => 'api']);
207207
}

0 commit comments

Comments
 (0)