andersao / andersao/l5-repository

appends bug on create method

Aberta
#753 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
PHP
Estrelas
4.2k
Forks
880
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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 {
...
}

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.