From 12accadf0f9bd116325f2bdaa5b0eea18a96ba41 Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Mon, 14 Oct 2024 21:16:08 +0200 Subject: [PATCH] fix lazy loading --- src/Concerns/HasMedia.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Concerns/HasMedia.php b/src/Concerns/HasMedia.php index 04fba95..1294787 100644 --- a/src/Concerns/HasMedia.php +++ b/src/Concerns/HasMedia.php @@ -222,6 +222,7 @@ public function clearMediaCollection( $media = $this->getMedia($collectionName, $collectionGroup) ->except($except) + ->loadMissing(['conversions']) ->each(fn ($media) => $media->delete()); $this->setRelation(