set attributes and save instead of creating via mass assignment to play nicer with various features and avoid requiring fillable properties to be set
This commit is contained in:
parent
29740ea1e8
commit
fc8e258c6d
|
|
@ -137,7 +137,9 @@ class TagList extends FormWidgetBase
|
|||
$newTags = $this->customTags ? array_diff($names, $existingTags) : [];
|
||||
|
||||
foreach ($newTags as $newTag) {
|
||||
$newModel = $relationModel::create([$this->nameFrom => $newTag]);
|
||||
$newModel = new $relationModel;
|
||||
$newModel->{$this->nameFrom} = $newTag;
|
||||
$newModel->save();
|
||||
$existingTags[$newModel->getKey()] = $newTag;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue