Sure. It's actually from a DB repository which extends an interface. Can't figure it out. BTW... I am using the package Entrust.
public function getRoles($users)
{
foreach($users as $user){
$roles[] = \User::with('roles')->find($user->id);
}
return $roles;
}
I don't see what's the problem. You can still use the parameters like:
$role->id
And so on..
I'm trying to get the roles for the user based on the user id. Not a role name based on $role->id
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community