<?php
 namespace App\EventHooks\Ticket; use App\EventHooks\HookEvent; use App\Models\Ticket; class TicketPriorityChanged extends HookEvent { public const HOOK = 'TicketPriorityChange'; public function ticket(): ?Ticket { $t = $this->get('ticket'); if ($t instanceof Ticket) { return $t; } $id = $this->get('ticket_id') ?? $this->get('ticketid'); return $id ? Ticket::find($id) : null; } public function newPriority(): mixed { return $this->get('priority'); } public function oldPriority(): mixed { return $this->get('old_priority'); } } 