Skip to content

Commit be9360e

Browse files
authored
Add Laravel 13 support (#2766)
Closes #2761 Switch CI from illuminate/contracts to laravel/framework to avoid the standalone package conflict introduced in Laravel 13. Remove static from closure passed to AuthManager::extend() — Laravel 13 binds $this to it, which errors on static closures.
1 parent a39b5b2 commit be9360e

File tree

5 files changed

+41
-21
lines changed

5 files changed

+41
-21
lines changed

.github/workflows/validate.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ jobs:
2828
- "8.2"
2929
- "8.3"
3030
- "8.4"
31+
- "8.5"
3132
laravel-version:
3233
- "^9"
3334
- "^10"
3435
- "^11"
3536
- "^12"
37+
- "^13"
3638
composer:
3739
- name: lowest
3840
arg: "--prefer-lowest --prefer-stable"
@@ -49,6 +51,12 @@ jobs:
4951
laravel-version: "^12"
5052
- php-version: "8.1"
5153
laravel-version: "^12"
54+
- php-version: "8.0"
55+
laravel-version: "^13"
56+
- php-version: "8.1"
57+
laravel-version: "^13"
58+
- php-version: "8.2"
59+
laravel-version: "^13"
5260

5361
steps:
5462
- uses: actions/checkout@v4
@@ -74,7 +82,7 @@ jobs:
7482

7583
- run: >
7684
composer require
77-
illuminate/contracts:${{ matrix.laravel-version }}
85+
laravel/framework:${{ matrix.laravel-version }}
7886
--no-interaction
7987
--prefer-dist
8088
--no-progress
@@ -96,11 +104,13 @@ jobs:
96104
- "8.2"
97105
- "8.3"
98106
- "8.4"
107+
- "8.5"
99108
laravel-version:
100109
- "^9"
101110
- "^10"
102111
- "^11"
103112
- "^12"
113+
- "^13"
104114
os:
105115
- ubuntu-latest
106116
composer:
@@ -119,6 +129,12 @@ jobs:
119129
laravel-version: "^12"
120130
- php-version: "8.1"
121131
laravel-version: "^12"
132+
- php-version: "8.0"
133+
laravel-version: "^13"
134+
- php-version: "8.1"
135+
laravel-version: "^13"
136+
- php-version: "8.2"
137+
laravel-version: "^13"
122138

123139
services:
124140
mysql:
@@ -160,7 +176,7 @@ jobs:
160176

161177
- run: >
162178
composer require
163-
illuminate/contracts:${{ matrix.laravel-version }}
179+
laravel/framework:${{ matrix.laravel-version }}
164180
--no-interaction
165181
--prefer-dist
166182
--no-progress
@@ -174,8 +190,8 @@ jobs:
174190

175191
strategy:
176192
matrix:
177-
php-version: ["8.4"]
178-
laravel-version: ["^12"]
193+
php-version: ["8.5"]
194+
laravel-version: ["^13"]
179195

180196
services:
181197
mysql:
@@ -210,7 +226,7 @@ jobs:
210226

211227
- run: composer remove --dev phpbench/phpbench rector/rector --no-update
212228

213-
- run: composer require illuminate/contracts:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress
229+
- run: composer require laravel/framework:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress
214230

215231
- run: vendor/bin/phpunit --coverage-clover=coverage.xml
216232

@@ -222,8 +238,8 @@ jobs:
222238

223239
strategy:
224240
matrix:
225-
php-version: ["8.4"]
226-
laravel-version: ["^12"]
241+
php-version: ["8.5"]
242+
laravel-version: ["^13"]
227243

228244
steps:
229245
- uses: actions/checkout@v4
@@ -240,6 +256,6 @@ jobs:
240256
path: ~/.composer/cache
241257
key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}
242258

243-
- run: composer require illuminate/contracts:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress
259+
- run: composer require laravel/framework:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress
244260

245261
- run: vendor/bin/phpbench run --progress=none --report=aggregate

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ You can find and compare releases at the [GitHub release page](https://github.co
99

1010
## Unreleased
1111

12+
### Added
13+
14+
- Support Laravel 13
15+
1216
## v6.65.0
1317

1418
### Added

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
"php": "^8",
3030
"ext-json": "*",
3131
"haydenpierce/class-finder": "^0.4 || ^0.5",
32-
"illuminate/auth": "^9 || ^10 || ^11 || ^12",
33-
"illuminate/bus": "^9 || ^10 || ^11 || ^12",
34-
"illuminate/contracts": "^9 || ^10 || ^11 || ^12",
35-
"illuminate/http": "^9 || ^10 || ^11 || ^12",
36-
"illuminate/pagination": "^9 || ^10 || ^11 || ^12",
37-
"illuminate/queue": "^9 || ^10 || ^11 || ^12",
38-
"illuminate/routing": "^9 || ^10 || ^11 || ^12",
39-
"illuminate/support": "^9 || ^10 || ^11 || ^12",
40-
"illuminate/validation": "^9 || ^10 || ^11 || ^12",
32+
"illuminate/auth": "^9 || ^10 || ^11 || ^12 || ^13",
33+
"illuminate/bus": "^9 || ^10 || ^11 || ^12 || ^13",
34+
"illuminate/contracts": "^9 || ^10 || ^11 || ^12 || ^13",
35+
"illuminate/http": "^9 || ^10 || ^11 || ^12 || ^13",
36+
"illuminate/pagination": "^9 || ^10 || ^11 || ^12 || ^13",
37+
"illuminate/queue": "^9 || ^10 || ^11 || ^12 || ^13",
38+
"illuminate/routing": "^9 || ^10 || ^11 || ^12 || ^13",
39+
"illuminate/support": "^9 || ^10 || ^11 || ^12 || ^13",
40+
"illuminate/validation": "^9 || ^10 || ^11 || ^12 || ^13",
4141
"laragraph/utils": "^1.5 || ^2",
4242
"thecodingmachine/safe": "^1 || ^2 || ^3",
4343
"webonyx/graphql-php": "^15"
@@ -49,7 +49,7 @@
4949
"fakerphp/faker": "^1.21",
5050
"google/protobuf": "^3.21 || ^4.33.6",
5151
"larastan/larastan": "^2.9.14 || ^3.0.4",
52-
"laravel/framework": "^9 || ^10 || ^11 || ^12",
52+
"laravel/framework": "^9 || ^10 || ^11 || ^12 || ^13",
5353
"laravel/legacy-factories": "^1.1.1",
5454
"laravel/pennant": "^1",
5555
"laravel/scout": "^8 || ^9 || ^10",
@@ -58,7 +58,7 @@
5858
"mll-lab/php-cs-fixer-config": "^5",
5959
"mockery/mockery": "^1.5",
6060
"nesbot/carbon": "^2.62.1 || ^3.8.4",
61-
"orchestra/testbench": "^7.50 || ^8.32 || ^9.10 || ^10.1",
61+
"orchestra/testbench": "^7.50 || ^8.32 || ^9.10 || ^10.1 || ^11",
6262
"phpbench/phpbench": "^1.2.6",
6363
"phpstan/extension-installer": "^1",
6464
"phpstan/phpstan": "^1.12.18 || ^2",

src/Subscriptions/SubscriptionServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function boot(EventsDispatcher $dispatcher, ConfigRepository $configRepos
6363
$this->app->bind(SubscriptionIterator::class, AuthenticatingSyncIterator::class);
6464

6565
$this->app->make(AuthManager::class)
66-
->extend(SubscriptionGuard::GUARD_NAME, static fn (): SubscriptionGuard => new SubscriptionGuard());
66+
->extend(SubscriptionGuard::GUARD_NAME, fn (): SubscriptionGuard => new SubscriptionGuard());
6767
}
6868
}
6969

tests/Unit/Subscriptions/Iterators/AuthenticatingSyncIteratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testSetsAndResetsGuardContextAfterEachIteration(): void
5656

5757
$authManager = $this->app->make(AuthManager::class);
5858

59-
$authManager->extend(SubscriptionGuard::GUARD_NAME, static fn (): SubscriptionGuard => $guard);
59+
$authManager->extend(SubscriptionGuard::GUARD_NAME, fn (): SubscriptionGuard => $guard);
6060

6161
$processedItems = [];
6262
$authenticatedUsers = [];

0 commit comments

Comments
 (0)