-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default auth guard is wrong for Laravel 11, config not updating #2729
Comments
If $possible_guards is not a single value, then it is coming from laravel-permission/src/Guard.php Lines 41 to 56 in 05f620c
... which uses collection methods to query and filter (not sort) values coming back from Is your |
Description
I've just upgraded my Laravel project to Laravel 11 from Laravel 10. I've flushed caches. I'm getting the error:
Coming from within the
RoleDoesNotExist
class line 11.My
User
model definesHasRoles
, and my default auth gaurd in my config file isapi
, notweb
. I haven't made any changes to myUser
model. Someone suggests this but in my project, I wasn't defining this in Laravel 10. So I think this is a bug.Steps To Reproduce
My
auth.php
config:Example Application
No response
Version of spatie/laravel-permission package:
6.4.0
Version of laravel/framework package:
11.25
PHP version:
8.3.9
Database engine and version:
MySQL 8
OS: Windows/Mac/Linux version:
Mac
Additional context
My project uses Laravel Sanctum and is an API to a Nuxt front-end. The following in your code:
$possible_guards
appears to return['web', 'api']
in this order. But changing them around in my config doesn't work. They're always in this order. In addition, my default issanctum
.The text was updated successfully, but these errors were encountered: