src/Engine/Traits/FromModelTraitPart/StoreUpdateDeleteTrait.php
public function store($attributes)
    {
        $attributes = $this->formatStoreAttributes($attributes);

        $model = $this->model->create($this->mapAttributesWithScope($attributes));

        if ($this->canOrder()) {
            if ($this->storeInLastPlace) {
                $attr = $this->crudeSetup->getOrderAttribute();
                $model->$attr = $model->id;
                $model->save();
            }
            $this->resetOrder();
        }

        $apiModel = $this->getById($model->id);

        $this->afterStore($apiModel, $attributes);

        return $apiModel;
    }
public function store($attributes)
    {
        $attributes = $this->formatStoreAttributes($attributes);

        $model = $this->model->create($this->mapAttributesWithScope($attributes));

        if ($this->canOrder()) {
            if ($this->storeInLastPlace) {
                $attr = $this->crudeSetup->getOrderAttribute();
                $model->$attr = $model->id;
                $model->save();
            }
            $this->resetOrder();
        }

        $apiModel = $this->getById($model->id);

        $this->afterStore($apiModel, $attributes);

        return $apiModel;
    }
public function store ( $ attributes ) { $ attributes = $ this -> formatStoreAttributes ( $ attributes ) ; $ model = $ this -> model -> create ( $ this -> mapAttributesWithScope ( $ attributes ) ) ; if ( $ this -> canOrder ( ) ) { if ( $ this -> storeInLastPlace ) { $ attr = $ this -> crudeSetup -> getOrderAttribute ( ) ; $ model -> $ attr = $ model -> id ; $ model -> save ( ) ; } $ this -> resetOrder ( ) ; } $ apiModel = $ this -> getById ( $ model -> id ) ; $ this -> afterStore ( $ apiModel , $ attributes ) ; return $ apiModel ; }
Store new model
@param  array $attributes
@return Model
Store new model