<?php
 namespace App\EventHooks\System; use App\EventHooks\HookEvent; use App\Models\ClientProduct; class SslCertificateIssued extends HookEvent { public const HOOK = 'SSLCertificateIssued'; public function serviceId(): ?int { $id = $this->get('service_id') ?? $this->get('client_product_id'); return $id ? (int) $id : null; } public function service(): ?ClientProduct { $id = $this->serviceId(); return $id ? ClientProduct::find($id) : null; } public function domain(): ?string { return $this->get('domain'); } } 