Skip to content
Discussion options

You must be logged in to vote

@soluzione-software you have more information about multiple guards on spatie laravel-permission docs: https://spatie.be/docs/laravel-permission/v5/basic-usage/multiple-guards 👌

Make sure about;

  1. your user()->can('...') is being applied to the correct guard, if you pass nothing, it will be applied to the default guard. If you want to specify a guard, send user()->can('...', $guard).

  2. your roles/guards are being correctly assigned on roles table.

  3. your relations between users and roles/permissions are being correctly stored on model_has_roles and model_has_permissions.

    Note there must be some App\Models\User and some App\Models\Admin 👌

One of this places may be wrong, and that's why…

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by promatik
Comment options

You must be logged in to vote
1 reply
@promatik
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants