code: public function update(array $attributes, $id)
      {
          $defaults = ["{$this->getRelationName()}" => []];
          $attributes = array_merge($defaults, $attributes);
          $model = parent::update($attributes, $id);
          $model->{$this->getShortRelationName()}()->sync($attributes["{$this->getRelationName()}"]);
          return $this->parserResult($model);
      }
docs: Update attributes
  
  @param array $attributes
  @param integer $id
  
  @return Model