Skip to content

Commit afd3620

Browse files
feat: Laravel 13 support with CI fixes
- Add ^13 to illuminate/contracts, illuminate/http, illuminate/support - Update docs/Support.md with Laravel 13, 12, and 11 support matrix - Add PHP 8.4 to CI test matrix - Disable static_lambda CS Fixer rule (AuthManager::extend() uses bindTo()) - Change auth guard closures from static to non-static for PHP 8.5+ compat - Cap Psalm to <6.5 (requires PHP >=8.3.16, CI runner has 8.3.6) - Allow Psalm 6 in psalm.xml.dist and rector.php Based on #486 by @cosmastech, with CI fixes by @sergix44 and @stegeto22.
1 parent 6b2bc01 commit afd3620

7 files changed

Lines changed: 31 additions & 16 deletions

File tree

.github/workflows/matrix.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"include": [
33
{ "php": "8.2" },
4-
{ "php": "8.3" }
4+
{ "php": "8.3" },
5+
{ "php": "8.4" }
56
]
67
}

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
'standardize_increment' => true,
204204
'standardize_not_equals' => true,
205205
'statement_indentation' => true,
206-
'static_lambda' => true,
206+
'static_lambda' => false,
207207
'strict_comparison' => true,
208208
'strict_param' => true,
209209
'string_length_to_empty' => true,

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
"php": "^8.2",
3939
"ext-json": "*",
4040
"auth0/auth0-php": "^8.19",
41-
"illuminate/contracts": "^11 || ^12",
42-
"illuminate/http": "^11 || ^12",
43-
"illuminate/support": "^11 || ^12",
41+
"illuminate/contracts": "^11 || ^12 || ^13",
42+
"illuminate/http": "^11 || ^12 || ^13",
43+
"illuminate/support": "^11 || ^12 || ^13",
4444
"psr-discovery/all": "^1",
4545
"psr/cache": "^2 || ^3"
4646
},
@@ -60,7 +60,7 @@
6060
"spatie/laravel-ray": "^1.40",
6161
"squizlabs/php_codesniffer": "^3",
6262
"symfony/cache": "^6 || ^7",
63-
"vimeo/psalm": "^5",
63+
"vimeo/psalm": "^5 || ^6 <6.5",
6464
"wikimedia/composer-merge-plugin": "^2"
6565
},
6666
"minimum-stability": "dev",

docs/Support.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ You will also need [Composer](https://getcomposer.org/) and an [Auth0 account](h
66

77
### Supported Laravel Releases
88

9-
The next major release of Laravel is forecasted for Q1 2025. We anticipate supporting it upon release.
10-
11-
| Laravel | SDK | PHP | Supported Until |
12-
| ---------------------------------------------- | ----- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------ |
13-
| [11.x](https://laravel.com/docs/11.x/releases) | 7.13+ | [8.3](https://www.php.net/releases/8.3/en.php) | Approx. [March 2026](https://laravel.com/docs/11.x/releases#support-policy) (EOL for Laravel 11) |
14-
| | | [8.2](https://www.php.net/releases/8.2/en.php) | Approx. [Dec 2025](https://www.php.net/supported-versions.php) (EOL for PHP 8.2) |
9+
| Laravel | SDK | PHP | Supported Until |
10+
| ---------------------------------------------- | ------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------ |
11+
| [13.x](https://laravel.com/docs/13.x/releases) | 7.21+ | [8.4](https://www.php.net/releases/8.4/en.php) | Approx. [Dec 2028](https://www.php.net/supported-versions.php) (EOL for PHP 8.4) |
12+
| | | [8.3](https://www.php.net/releases/8.3/en.php) | Approx. [March 2028](https://laravel.com/docs/13.x/releases#support-policy) (EOL for Laravel 13) |
13+
| [12.x](https://laravel.com/docs/12.x/releases) | 7.16+ | [8.4](https://www.php.net/releases/8.4/en.php) | Approx. [Dec 2028](https://www.php.net/supported-versions.php) (EOL for PHP 8.4) |
14+
| | | [8.3](https://www.php.net/releases/8.3/en.php) | Approx. [Feb 2027](https://laravel.com/docs/12.x/releases#support-policy) (EOL for Laravel 12) |
15+
| | | [8.2](https://www.php.net/releases/8.2/en.php) | Approx. [Dec 2026](https://www.php.net/supported-versions.php) (EOL for PHP 8.2) |
16+
| [11.x](https://laravel.com/docs/11.x/releases) | 7.13+ | [8.3](https://www.php.net/releases/8.3/en.php) | Approx. [March 2026](https://laravel.com/docs/11.x/releases#support-policy) (EOL for Laravel 11) |
17+
| | | [8.2](https://www.php.net/releases/8.2/en.php) | Approx. [Dec 2026](https://www.php.net/supported-versions.php) (EOL for PHP 8.2) |
1518

1619
We strive to support all actively maintained Laravel releases, prioritizing support for the latest major version with our SDK. If a new Laravel major introduces breaking changes, we may have to end support for past Laravel versions earlier than planned.
1720

psalm.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
<MixedArgument errorLevel="suppress"/>
2222
<MixedArgumentTypeCoercion errorLevel="suppress"/>
2323
<MixedAssignment errorLevel="suppress"/>
24-
<MixedInferredReturnType errorLevel="suppress"/>
2524
<MixedReturnStatement errorLevel="suppress"/>
2625
<DeprecatedClass errorLevel="suppress"/>
2726
<DeprecatedInterface errorLevel="suppress"/>
27+
<MissingOverrideAttribute errorLevel="suppress"/>
2828
</issueHandlers>
2929

3030
<plugins>

rector.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,17 @@
223223
__DIR__ . '/src',
224224
]);
225225

226+
// Laravel AuthManager::extend() resolves callbacks in a way that breaks with
227+
// static arrow functions on Laravel 13; keep non-static `fn` here.
228+
$rectorConfig->skip([
229+
StaticArrowFunctionRector::class => [
230+
__DIR__ . '/src/ServiceProviderAbstract.php',
231+
],
232+
StaticClosureRector::class => [
233+
__DIR__ . '/src/ServiceProviderAbstract.php',
234+
],
235+
]);
236+
226237
$rectorConfig->ruleWithConfiguration(
227238
RenameFunctionRector::class,
228239
[

src/ServiceProviderAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ final public function boot(
3434
$this->mergeConfigFrom(implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'config', 'auth0.php']), 'auth0');
3535
$this->publishes([implode(DIRECTORY_SEPARATOR, [__DIR__, '..', 'config', 'auth0.php']) => config_path('auth0.php')], 'auth0');
3636

37-
$auth->extend('auth0.authenticator', static fn (Application $app, string $name, array $config): AuthenticationGuard => new AuthenticationGuard($name, $config));
38-
$auth->extend('auth0.authorizer', static fn (Application $app, string $name, array $config): AuthorizationGuard => new AuthorizationGuard($name, $config));
37+
$auth->extend('auth0.authenticator', fn (Application $app, string $name, array $config): AuthenticationGuard => new AuthenticationGuard($name, $config));
38+
$auth->extend('auth0.authorizer', fn (Application $app, string $name, array $config): AuthorizationGuard => new AuthorizationGuard($name, $config));
3939
$auth->provider('auth0.provider', static fn (Application $app, array $config): UserProvider => new UserProvider($config));
4040

4141
$router->aliasMiddleware('guard', GuardMiddleware::class);
@@ -149,7 +149,7 @@ final public function registerDeprecated(
149149
Router $router,
150150
AuthManager $auth,
151151
): void {
152-
$auth->extend('auth0.guard', static fn (Application $app, string $name, array $config): Guard => new Guard($name, $config));
152+
$auth->extend('auth0.guard', fn (Application $app, string $name, array $config): Guard => new Guard($name, $config));
153153

154154
$router->aliasMiddleware('auth0.authenticate.optional', AuthenticateOptionalMiddleware::class);
155155
$router->aliasMiddleware('auth0.authenticate', AuthenticateMiddleware::class);

0 commit comments

Comments
 (0)