app\HasRoles::hasRole PHP Method

hasRole() public method

Determine if the user has the given role.
public hasRole ( mixed $role ) : boolean
$role mixed
return boolean
    public function hasRole($role)
    {
        if (is_string($role)) {
            return $this->roles->contains('name', $role);
        }
        return !!$role->intersect($this->roles)->count();
    }