Rule::requiredIf(!$this->libraryItem->id)

This commit is contained in:
HolgerHatGarKeineNode
2023-02-11 13:57:01 +01:00
parent 9f1dda9b61
commit e65ad29aad

View File

@@ -67,8 +67,10 @@ class NewsArticleForm extends Component
$this->validate(); $this->validate();
$this->libraryItem->save(); $this->libraryItem->save();
if ($this->image) {
$this->libraryItem->addMedia($this->image) $this->libraryItem->addMedia($this->image)
->toMediaCollection('main'); ->toMediaCollection('main');
}
return to_route('article.overview', ['country' => null]); return to_route('article.overview', ['country' => null]);
} }