code: public function assignRole($role)
      {
          if (is_string($role)) {
              return $this->roles()->attach(Role::where('slug', $role)->first());
          }
  
          return $this->roles()->attach($role);
      }
docs: Assign a role to this user
  
  @param string|Role $role
  @return boolean