-
Notifications
You must be signed in to change notification settings - Fork 11.5k
Closed
Labels
Description
Laravel Version
11.43.0
PHP Version
8.3.17
Database Driver & Version
MySQL 8.2
Description
Bug
When defining guards after migrating from Laravel 10 to 11, the config does no longer respect the order it was defined.
This creates trouble for us as Laravel Nova Impersonation selects auth guard based on the ordering of the auth guards where session driver is set & provider is user, and web
is automatically moved to the top of the array.
Solution
Laravel should respect the ordering it was defined, it should also be possible to unregister the web guard.
Also Laravel Nova should not 'guess' the auth guard like this, so I post an issue there as well.
Related issue: #50934
Steps To Reproduce
config/auth.php
'guards' => [
'api' => [
'driver' => 'jwt',
'provider' => 'customer',
],
'nova' => [
'driver' => 'session',
'provider' => 'users',
],
'web' => [
'driver' => 'session',
'provider' => 'users',
],
]
Result
"guards": {
"web":{
"driver":"session",
"provider":"users"
},
"api":{
"driver":"jwt",
"provider":"customer"
},
"nova":{
"driver":"session",
"provider":"users"
},
}
Related Laravel Nova issue: laravel/nova-issues#6796