<?php
 namespace App\EventHooks\Service; use App\EventHooks\HookEvent; use App\Models\Client; use App\Models\ClientProduct; class ModuleCreated extends HookEvent { public const HOOK = 'AfterModuleCreate'; public function service(): ?ClientProduct { $s = $this->get('service'); if ($s instanceof ClientProduct) { return $s; } $id = $this->get('service_id') ?? $this->get('serviceid'); return $id ? ClientProduct::find($id) : null; } public function client(): ?Client { $id = $this->get('client_id') ?? $this->get('user_id') ?? $this->get('userid'); return $id ? Client::find($id) : null; } } 