everybody! I am using Laravel Spatie Permission Package. And I can get user's all assigned permissions like this.
$user->getAllPermissions()
However, I want to get all permissions with eager loading. Maybe like this.
$users = User::with('getAllPermissions')->get();
But this didn't worked.
I tried
$users = user::with('permissions')->get();
But query counts were same result with
$users = user::get();
So $user->getAllPermissions()
is already eager loaded query?
Or is there any eager loaded query?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3asq2Vz
via IFTTT
Aucun commentaire:
Enregistrer un commentaire