homepage->clearFeaturedAndMedalCaches(); $this->queueFeaturedThumbnailRefresh($feature); $this->queueCreatorRebuild($feature); } public function updated(ArtworkFeature $feature): void { $this->homepage->clearFeaturedAndMedalCaches(); $this->queueFeaturedThumbnailRefresh($feature); $this->queueCreatorRebuild($feature); } public function deleted(ArtworkFeature $feature): void { $this->homepage->clearFeaturedAndMedalCaches(); $this->queueCreatorRebuild($feature); } public function restored(ArtworkFeature $feature): void { $this->homepage->clearFeaturedAndMedalCaches(); $this->queueFeaturedThumbnailRefresh($feature); $this->queueCreatorRebuild($feature); } public function forceDeleted(ArtworkFeature $feature): void { $this->homepage->clearFeaturedAndMedalCaches(); $this->queueCreatorRebuild($feature); } /** * Ensure the featured hero variants (and their DB-persisted existence state) * are ready before the next homepage guest-cache warm cycle picks this * artwork up as the hero winner, so the public request never has to check * the remote disk itself. */ private function queueFeaturedThumbnailRefresh(ArtworkFeature $feature): void { $artworkId = (int) $feature->artwork_id; if ($artworkId <= 0) { return; } $artwork = $feature->relationLoaded('artwork') ? $feature->artwork : Artwork::withTrashed()->find($artworkId); if (! $artwork instanceof Artwork || empty($artwork->hash) || empty($artwork->file_ext)) { return; } GenerateFeaturedArtworkThumbnailsJob::dispatch($artworkId); } private function queueCreatorRebuild(ArtworkFeature $feature): void { $artwork = $feature->relationLoaded('artwork') ? $feature->artwork : Artwork::withTrashed()->find($feature->artwork_id); if (! $artwork) { return; } $this->journeys->requestRebuild((int) $artwork->user_id); } }