You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public function deleteImages(string $imgIds): void
{
if (isset($imgIds)) {
$deleting = explode(',', $imgIds);
foreach ($deleting as $imageId) {
Media::find($imageId)->delete();
}
}
}
As you can see, I used the ->delete() method described in docs.
I checked its functionality by deleting the image with ID 15.
The result can be seen in the screenshot:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I make a method to remove an image.
It looks like
As you can see, I used the
->delete()
method described in docs.I checked its functionality by deleting the image with ID 15.
The result can be seen in the screenshot:
Is it correct behavior?
Beta Was this translation helpful? Give feedback.
All reactions