<?php
 namespace App\EventHooks\Service; use App\EventHooks\HookEvent; use App\Models\ClientProduct; class ModuleTerminateFailed extends HookEvent { public const HOOK = 'AfterModuleTerminateFailed'; 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 failureMessage(): ?string { return $this->get('failureResponseMessage'); } } 