What seems to be the problem:
delete multiple image
Steps to Reproduce:
Are you using the latest version of Livewire:
galeri relation addImage
What seems to be the problem:
delete multiple image
Steps to Reproduce:
Are you using the latest version of Livewire:
galeri relation addImage
You could use a foreach loop for that. I would first do the foreach loop to delete each image and then delete the gallery record itself.
If the relationship is “photo” and the column name is “url”:
foreach ($galeri->photos as $photo) {
Storage::disk('public')->delete($photo->url);
}
$galeri->delete();
Like @WinModify said above and looking your own code maybe must be like:
public function delete()
{
$galleri = Model_Galeri::find($this->modelId);
$collectAddImages = $galleri->addImage;
Storage::disk('public')->delete($galleri->image);
foreach($collectAddImages as $item)
Storage::disk('public')->delete($item->path);
Model_Galeri::delete($this->modelId);
}