public function hasRole($role): bool
    {
        $slug = str_slug($role);

        return (bool) $this->roles->where('slug', $slug)->count();
    }
public function hasRole($role): bool
    {
        $slug = str_slug($role);

        return (bool) $this->roles->where('slug', $slug)->count();
    }
public function hasRole ( $ role ) : bool { $ slug = str_slug ( $ role ) ; return ( bool ) $ this -> roles -> where ( 'slug' , $ slug ) -> count ( ) ; }
Checks if the model has the given role assigned.

@param  string  $role
@return boolean
Checks if the model has the given role assigned .