<?php
 namespace App\EventHooks\Client; use App\EventHooks\HookEvent; use App\Models\Client; class ClientClosed extends HookEvent { public const HOOK = 'ClientClose'; public function client(): ?Client { $c = $this->get('client'); if ($c instanceof Client) { return $c; } $id = $this->get('client_id') ?? $this->get('user_id') ?? $this->get('userid'); return $id ? Client::find($id) : null; } } 