src/Engine/Traits/FromModelTraitPart/StoreUpdateDeleteTrait.php
public function updateById($id, $attributes)
    {
        $attributes = $this->formatUpdateAttributes($attributes);

        $model = $this->model->find($id);

        if (empty($model))
            return $this;

        $model->update($this->mapAttributesWithScope($attributes));

        $apiModel = $this->getById($model->id);
        $this->afterUpdate($apiModel, $attributes);
        return $apiModel;
    }
public function updateById($id, $attributes)
    {
        $attributes = $this->formatUpdateAttributes($attributes);

        $model = $this->model->find($id);

        if (empty($model))
            return $this;

        $model->update($this->mapAttributesWithScope($attributes));

        $apiModel = $this->getById($model->id);
        $this->afterUpdate($apiModel, $attributes);
        return $apiModel;
    }
public function updateById ( $ id , $ attributes ) { $ attributes = $ this -> formatUpdateAttributes ( $ attributes ) ; $ model = $ this -> model -> find ( $ id ) ; if ( empty ( $ model ) ) return $ this ; $ model -> update ( $ this -> mapAttributesWithScope ( $ attributes ) ) ; $ apiModel = $ this -> getById ( $ model -> id ) ; $ this -> afterUpdate ( $ apiModel , $ attributes ) ; return $ apiModel ; }
Update by id
@param  integer $id
@param  array   $attributes
@return Model
Update by id