1
I am making a consultation to the bank and is being returned a Collection... How do I stop instead of having to call $role->role
to get the column value, get the same behavior by calling only $role
?
Current code:
$roles = Role::all('role');
foreach ($roles as $role) {
Gate::define($role->role, function ($user) use ($role) {
return $user->roles->contains('role', $role->role);
});
}
Try Role::all('role')->toArray();
– Wictor Chaves
I didn’t understand your doubt?
– novic