<?php
 namespace App\EventHooks\Client; use App\EventHooks\HookEvent; use App\Models\ClientContact; class ContactAdded extends HookEvent { public const HOOK = 'ContactAdd'; public function contact(): ?ClientContact { $c = $this->get('contact'); if ($c instanceof ClientContact) { return $c; } $id = $this->get('contact_id') ?? $this->get('contactid'); return $id ? ClientContact::find($id) : null; } } 