public function hasRole($role)
    {
        $roles = array_column($this->roles->toArray(), 'name');
        return array_search($role, $roles) > -1;
    }
public function hasRole($role)
    {
        $roles = array_column($this->roles->toArray(), 'name');
        return array_search($role, $roles) > -1;
    }
public function hasRole ( $ role ) { $ roles = array_column ( $ this -> roles -> toArray ( ) , 'name' ) ; return array_search ( $ role , $ roles ) > - 1 ; }
Check if user has role

@param  string  $role
@return boolean
Check if user has role