From 09f32894f1accf8c7c0373f18298936a6d49f023 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Thu, 30 Nov 2023 19:34:39 +0000 Subject: [PATCH] Clear eloquent blink cache in cache old uri listener (#149) --- src/Listeners/CacheOldUri.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Listeners/CacheOldUri.php b/src/Listeners/CacheOldUri.php index 9333e58..69f8414 100644 --- a/src/Listeners/CacheOldUri.php +++ b/src/Listeners/CacheOldUri.php @@ -4,6 +4,7 @@ use Illuminate\Support\Facades\Cache; use Statamic\Events\EntrySaving; +use Statamic\Facades\Blink; use Statamic\Facades\Entry; class CacheOldUri @@ -14,7 +15,10 @@ public function handle(EntrySaving $entrySaving) return; } - $entry = Entry::find($entrySaving->entry->id()); + $id = $entrySaving->entry->id(); + + Blink::forget('eloquent-entry-'.$id); + $entry = Entry::find($id); if (! $entry || ! $uri = $entry->uri()) { return;