public function is($name)
    {
        foreach ($this->roles as $role) {
            if ($role->name == $name || $role->slug == $name || $role->id == $name) {
                return true;
            }
        }

        return false;
    }
public function is($name)
    {
        foreach ($this->roles as $role) {
            if ($role->name == $name || $role->slug == $name || $role->id == $name) {
                return true;
            }
        }

        return false;
    }
public function is ( $ name ) { foreach ( $ this -> roles as $ role ) { if ( $ role -> name == $ name || $ role -> slug == $ name || $ role -> id == $ name ) { return true ; } } return false ; }
Determine whether the user has role that given by name parameter.

@param $name

@return bool
Determine whether the user has role that given by name parameter .