I'm doing a query to the bank and a Collection is being returned ... How do I instead of having to call $role->role
to get the column value, achieve 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);
});
}