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