Skip to content

Commit

Permalink
Clear the correct site cache when globals change (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWez98 authored Aug 27, 2024
1 parent 4c4d017 commit edc5262
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RapidezStatamicServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Support\Facades\View;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Artisan;
use Rapidez\Statamic\Tags\Alternates;
use Statamic\Events\GlobalSetDeleted;
use Illuminate\Support\ServiceProvider;
Expand Down Expand Up @@ -95,7 +96,7 @@ public function bootListeners() : self
{
if ($this->currentSiteIsEnabled()) {
Event::listen([GlobalSetSaved::class, GlobalSetDeleted::class], function () {
Cache::forget('statamic-globals-' . Site::current()->handle());
Cache::forget('statamic-globals-' . Site::selected()->handle());
});

Eventy::addFilter('rapidez.statamic.category.entry.data', fn($category) => [
Expand Down

0 comments on commit edc5262

Please sign in to comment.