*/ class EntryUpdated extends WikiUpdatedEvent implements UpdateRelatedIndicesEvent { /** * Create a new event instance. * * @param AnimeThemeEntry $entry */ public function __construct(AnimeThemeEntry $entry) { parent::__construct($entry); $this->initializeEmbedFields($entry); } /** * Get the model that has fired this event. * * @return AnimeThemeEntry */ public function getModel(): AnimeThemeEntry { return $this->model; } /** * Get the description for the Discord message payload. * * @return string */ protected function getDiscordMessageDescription(): string { return "Entry '**{$this->getModel()->getName()}**' has been updated."; } /** * Perform updates on related indices. * * @return void */ public function updateRelatedIndices(): void { $entry = $this->getModel(); $entry->videos->each(fn (Video $video) => $video->searchable()); } }