-
|
Hello to everybody, I am new at Laravel and Spatie, and I am facing a weird problem (but i hope simple for you experts !) Using :
If i do this in my user controller code, it's work's fine : I can see DB table model_has_permissions is updated, and my Object is containing the permission :
But if try to get a list of all users with permissions/roles, using this snippet : This is time, the permissionClass is alway null : My App\Models\Users looks like this : And i have edited Any ideas what i am doing wrong ? Thanks a lot for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Try $data = Users::latest()->with('permissions')->paginate(20); |
Beta Was this translation helpful? Give feedback.
Try