It doesn't seem like there are any "easy" way to do this with Entrust. Maybe something like this?
$permission_id = 1;
$users = User::whereHas('roles', function($query) use ($permission_id) {
$query->whereHas('perms', function($query) use ($permission_id) {
$query->where('id', '=', $permission_id);
});
})->get();
thomastkim said:
It doesn't seem like there are any "easy" way to do this with Entrust. Maybe something like this?
$permission_id = 1; $users = User::whereHas('roles', function($query) use ($permission_id) { $query->whereHas('perms', function($query) use ($permission_id) { $query->where('id', '=', $permission_id); }); })->get();
Thank you very much!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community