issues
search
romanbican
/
roles
Powerful package for handling roles and permissions in Laravel 5
MIT License
1.16k
stars
296
forks
source link
hasRole and permission works with $key not $value
#216
Open
alamallam
opened
7 years ago
junezzao
commented
6 years ago
Override hasRole() in User model if using Laravel >= 5.3
/**
Check if the user has role.
@param int|string $role
@return bool */ public function hasRole($role) { return $this->getRoles()->contains(function ($value, $key) use ($role) { return $role == $value->id || Str::is($role, $value->slug); }); }
Override hasRole() in User model if using Laravel >= 5.3
/**