l5-repository icon indicating copy to clipboard operation
l5-repository copied to clipboard

appends bug on create method

Open ronfuller opened this issue 3 years ago • 0 comments

The create method fails to save to the model when there are appends attributes on the model. The appends attributes are not on the model therefore fail the sql insert will generate an exception.

Just as was fixed for update() , the create() method needs setAppends

public function create(array $attributes) ... $this->model->setAppends([]); if ($this->versionCompare($this->app->version(), "5.2.*", ">")) { $attributes = $this->model->newInstance()->forceFill($attributes)->makeVisible($this->model->getHidden())->toArray(); } else { ... }

ronfuller avatar Mar 25 '21 14:03 ronfuller