Skip to content

Commit

Permalink
Clear eloquent blink cache in cache old uri listener (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell authored Nov 30, 2023
1 parent 6b5b9d9 commit 09f3289
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Listeners/CacheOldUri.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Support\Facades\Cache;
use Statamic\Events\EntrySaving;
use Statamic\Facades\Blink;
use Statamic\Facades\Entry;

class CacheOldUri
Expand All @@ -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;
Expand Down

0 comments on commit 09f3289

Please sign in to comment.