I think i found a way :
public function permissionsForUser($user) {
return $this->with(['roles.users' => function($q) use ($user) {
$q->where('users.id', $user->id);
}])->distinct()->pluck('permissions.name')->all();
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community