Skip to content

Laravel 13 compatibility#486

Closed
cosmastech wants to merge 13 commits intoauth0:mainfrom
cosmastech:patch-1
Closed

Laravel 13 compatibility#486
cosmastech wants to merge 13 commits intoauth0:mainfrom
cosmastech:patch-1

Conversation

@cosmastech
Copy link
Copy Markdown

Changes

Update composer requirements to support Laravel 13.

References

Testing

Contributor Checklist

Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
@cosmastech cosmastech changed the title Update Illuminate package versions to include ^13 Laravel 13 compatibility Mar 19, 2026
@cosmastech cosmastech requested a review from a team as a code owner March 19, 2026 20:53
@cosmastech cosmastech mentioned this pull request Mar 21, 2026
1 task
@hari-euka
Copy link
Copy Markdown

Can we please look into merging this as its becoming a blocker for our Laravel 13 upgrade.

@mattystowe
Copy link
Copy Markdown

as @hari-euka mentioned - this is a blocker to Laravel 13 upgrade and we would really appreciate this being approved and merged asap. Many thanks!

@hari-euka
Copy link
Copy Markdown

Hey @kishore7snehil can you please check this PR, so we will be able to upgrade to Laravel 13, seems like a lot of people are waiting on this.

hari-euka added a commit to hari-euka/laravel-auth0 that referenced this pull request Mar 27, 2026
Update illuminate package constraints to include ^13.

Support matrix changes (addressing review feedback from auth0#486):
- Add Laravel 13.x row with PHP 8.3 minimum (L13 requires PHP 8.3)
- No PHP 8.2 row for L13 (not supported by Laravel 13)
- Laravel 13 EOL set to March 2028 (released March 17, 2026)
- Add PHP 8.4 rows for Laravel 12 and 13 (actively supported, EOL Dec 2028)
- Remove outdated forecast text

Addresses feedback from kishore7snehil on auth0#486.
@hari-euka hari-euka mentioned this pull request Mar 27, 2026
2 tasks
Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
@cosmastech
Copy link
Copy Markdown
Author

@kishore7snehil I think I got everything you requested. 🙇

@hari-euka
Copy link
Copy Markdown

Hey @kishore7snehil can we pls have this sorted? Many thanks.

docs/Support.md Outdated
| | | [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.x](https://laravel.com/docs/12.x/releases) | 7.16+ | [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) |
| | | [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) |
| | | [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) |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as r3008

@kishore7snehil
Copy link
Copy Markdown
Contributor

kishore7snehil commented Mar 30, 2026

👋 @hari-euka , We are planning a minor release in the coming few days (before Friday), so I can include this in the same. If by any chance that release is cancelled or pushed, I'll cut a separate release by Thursday.

cc: @cosmastech

@hari-euka
Copy link
Copy Markdown

Thank you @kishore7snehil & @cosmastech

@sergix44
Copy link
Copy Markdown

sergix44 commented Mar 30, 2026

I would also test for php 8.4 and 8.5, especially since laravel 13 requires 8.3 at minimum, up to 8.5.

This is an error I'm getting on php 8.5, when trying to use your branch @cosmastech

... dependencies download ...
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   ErrorException 

  Cannot bind an instance to a static closure, this will be an error in PHP 9

  at vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:274
    270▕      * @return $this
    271▕      */
    272▕     public function extend($driver, Closure $callback)
    273▕     {
  ➜ 274▕         $this->customCreators[$driver] = $callback->bindTo($this, $this);
    275▕ 
    276▕         return $this;
    277▕     }
    278▕ 

      +9 vendor frames 

  10  [internal]:0
      Illuminate\Foundation\Application::{closure:Illuminate\Foundation\Application::boot():1131}(Object(Auth0\Laravel\ServiceProvider), "Auth0\Laravel\ServiceProvider")
      +5 vendor frames 

  16  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Seems because all these closures are declared as static:
https://github.com/auth0/laravel-auth0/blob/main/src/ServiceProviderAbstract.php#L37

cosmastech and others added 2 commits March 30, 2026 10:14
Co-authored-by: stegeto22 <stegeto22@users.noreply.github.com>
Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
@cosmastech
Copy link
Copy Markdown
Author

I would also test for php 8.4 and 8.5, especially since laravel 13 requires 8.3 at minimum, up to 8.5.

This is an error I'm getting on php 8.5, when trying to use your branch @cosmastech

... dependencies download ...
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   ErrorException 

  Cannot bind an instance to a static closure, this will be an error in PHP 9

  at vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php:274
    270▕      * @return $this
    271▕      */
    272▕     public function extend($driver, Closure $callback)
    273▕     {
  ➜ 274▕         $this->customCreators[$driver] = $callback->bindTo($this, $this);
    275▕ 
    276▕         return $this;
    277▕     }
    278▕ 

      +9 vendor frames 

  10  [internal]:0
      Illuminate\Foundation\Application::{closure:Illuminate\Foundation\Application::boot():1131}(Object(Auth0\Laravel\ServiceProvider), "Auth0\Laravel\ServiceProvider")
      +5 vendor frames 

  16  artisan:35
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Seems because all these closures are declared as static: https://github.com/auth0/laravel-auth0/blob/main/src/ServiceProviderAbstract.php#L37

Great callout! Thanks.

Updated the supported Laravel releases table to correct the order of PHP versions and their respective end-of-life dates.

Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
@stegeto22
Copy link
Copy Markdown

Should PHP 8.4 and 8.5 be added to .github/workflows/matrix.json? And 8.2 could be removed.

@sergix44
Copy link
Copy Markdown

Should PHP 8.4 and 8.5 be added to .github/workflows/matrix.json? And 8.2 could be removed.

I dont think 8.2 should be removed (since its still supporting laravel 12) but add 8.4 and 8.5 for sure

Signed-off-by: Luke Kuzmish <42181698+cosmastech@users.noreply.github.com>
@kishore7snehil
Copy link
Copy Markdown
Contributor

kishore7snehil commented Apr 6, 2026

I dont think 8.2 should be removed (since its still supporting laravel 12) but add 8.4 and 8.5 for sure

@cosmastech Are you planning to add these versions in the CI matrix? Also please take a look at failing UTs.

@cosmastech
Copy link
Copy Markdown
Author

I dont think 8.2 should be removed (since its still supporting laravel 12) but add 8.4 and 8.5 for sure

@cosmastech Are you planning to add these versions in the CI matrix? Also please take a look at failing UTs.

Working on it now. Thanks!

@cosmastech
Copy link
Copy Markdown
Author

There is an issue with psalm 6 (which is required for php 8.4)

Looking into this.

@cosmastech
Copy link
Copy Markdown
Author

cosmastech commented Apr 6, 2026

@kishore7snehil There's an issue with psalm 6. It does not like the MixedInferredReturnType (apparently this was removed from 5 -> 6)

When I remove it and run psalm:fix, we get a giant diff and many of the changes I don't think are appropriate for a patch release.

That said... I notice this project has both psalm and phpstan. Is there a reason that both are needed?

Unless I'm not expected to run psalter? That appears to fix things that aren't flagged as errors by psalm.

@kishore7snehil
Copy link
Copy Markdown
Contributor

kishore7snehil commented Apr 6, 2026

Thanks @cosmastech for the contribution and the follow-up fixes!

I've taken all your commits and resolved the remaining CI issues (capped Psalm to <6.5 due to a PHP version mismatch on the CI runner, and disabled the static_lambda CS Fixer rule since AuthManager::extend() uses bindTo()).

PR #491 is up with everything included. Appreciate the help from @hari-euka , @sergix44 and @stegeto22 as well.

kishore7snehil added a commit that referenced this pull request Apr 8, 2026
- 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.
kishore7snehil added a commit that referenced this pull request Apr 8, 2026
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.
@kishore7snehil
Copy link
Copy Markdown
Contributor

@cosmastech Please feel free to close this PR. The support has been released in v7.22.0.

@cosmastech cosmastech closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants