<?php
 namespace App\EventHooks\Service; use App\EventHooks\HookEvent; use App\Models\ClientProduct; use App\Models\Invoice; class ServiceRecurringCompleted extends HookEvent { public const HOOK = 'ServiceRecurringCompleted'; 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 invoice(): ?Invoice { $id = $this->get('invoice_id') ?? $this->get('invoiceid'); return $id ? Invoice::find($id) : null; } } 