From efbfd5495985912481e99954b8df16b6a850fa6b Mon Sep 17 00:00:00 2001 From: Adam Weston Date: Mon, 18 Dec 2023 12:46:22 -0500 Subject: [PATCH] Fix: delete glide cache for delete media item --- src/Observers/MediaObserver.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Observers/MediaObserver.php b/src/Observers/MediaObserver.php index e903be2e..9546812b 100644 --- a/src/Observers/MediaObserver.php +++ b/src/Observers/MediaObserver.php @@ -91,6 +91,10 @@ public function deleted(Media $media): void if (count(Storage::disk($media->disk)->allFiles($media->directory)) == 0) { Storage::disk($media->disk)->deleteDirectory($media->directory); } + + // Delete glide-cache for delete image + $server = app(config('curator.glide.server'))->getFactory(); + $server->deleteCache($media->path); } private function hasMediaUpload($media): bool