<?php
 namespace App\EventHooks\Invoice; use App\EventHooks\HookEvent; use App\Models\Invoice; class InvoicePaymentReminderSent extends HookEvent { public const HOOK = 'InvoicePaymentReminder'; public function invoice(): ?Invoice { $i = $this->get('invoice'); if ($i instanceof Invoice) { return $i; } $id = $this->get('invoice_id'); return $id ? Invoice::find($id) : null; } } 