-
Hi, does anyone know how to show multiple roles that are under a user? I have setup my permissions so a user can be under multiple roles, which is set easily enough using the following
I am however having trouble showing all roles a user relongs to in the same way? |
Beta Was this translation helpful? Give feedback.
Answered by
drbyte
Apr 20, 2021
Replies: 1 comment 1 reply
-
https://spatie.be/docs/laravel-permission/v4/basic-usage/basic-usage // get the names of the user's roles
$roles = $user->getRoleNames(); // Returns a collection |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
drbyte
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://spatie.be/docs/laravel-permission/v4/basic-usage/basic-usage