<?php
 namespace App\EventHooks\Catalog; use App\EventHooks\HookEvent; use App\Models\Post; class AnnouncementEdited extends HookEvent { public const HOOK = 'AnnouncementEdit'; public function announcement(): ?Post { $a = $this->get('announcement'); if ($a instanceof Post) { return $a; } $id = $this->get('announcement_id') ?? $this->get('announcementid'); return $id ? Post::find($id) : null; } } 