code: public function update(array $data, $id)
      {
          $resource = $this->model->find($id);
          
          if (! $resource) {
              return '';
          }
          
          $resource->update($data);
          
          return $resource;
      }
docs: Update a resource by id
  
  @param $data array
  @param $id int
  @return boolean