pageCacheService = app(PageCacheService::class); } /** * Handle the Page "created" event. */ public function created(Page $page): void { $this->pageCacheService->clearAllCacheByModel(); } /** * Handle the Page "updated" event. */ public function updated(Page $page): void { $this->pageCacheService->clearAllCacheByModel(); // Clear navigation cache if sort order changed if ($page->isDirty('sort')) { Cache::forget('navigation'); } } /** * Handle the Page "deleted" event. */ public function deleted(Page $page): void { $this->pageCacheService->clearAllCacheByModel(); } /** * Handle the Page "restored" event. */ public function restored(Page $page): void { // } /** * Handle the Page "force deleted" event. */ public function forceDeleted(Page $page): void { // } }