protected function hasRole($role)
    {
        return $this->getRoles()->contains(function ($key, $value) use ($role) {
            return $role == $value->id || Str::is($role, $value->slug);
        });
    }
protected function hasRole($role)
    {
        return $this->getRoles()->contains(function ($key, $value) use ($role) {
            return $role == $value->id || Str::is($role, $value->slug);
        });
    }
protected function hasRole ( $ role ) { return $ this -> getRoles ( ) -> contains ( function ( $ key , $ value ) use ( $ role ) { return $ role == $ value -> id || Str :: is ( $ role , $ value -> slug ) ; } ) ; }
Check if the user has role.

@param int|string $role
@return bool
Check if the user has role .