code: public function updateById($id, array $newAttributes)
      {
          $model = $this->getById($id);
          $results = $model->update($newAttributes);
  
          if(!$results){
              throw new UpdateFailedRepositoryException();
          }
  
          return $model;
      }
docs: Update a model given it's id and an array of attributes
  
  @param $id
  @param array $newAttributes
  @return mixed
  @throws UpdateFailedRepositoryException