-
Hi - I'm new to the Roles-Permissions product. When I test for a permission using auth()->user()->getPermissionNames(), the system returns an empty collection:
However, when I use: auth()->user()->roles()->with('permissions')->get(), I see that the user does have roles and permissions assigned:
It seems like I have everything wired together properly, but I must be missing something somewhere. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It is not the same laravel-permission/src/Traits/HasPermissions.php Lines 489 to 492 in 299fe4b auth()->user()->roles()->with('permissions')->get(); // via roles permissions
auth()->user()->permissions()->get(); // direct permissions |
Beta Was this translation helpful? Give feedback.
It is not the same
laravel-permission/src/Traits/HasPermissions.php
Lines 489 to 492 in 299fe4b