<?php
 namespace App\EventHooks\System; use App\EventHooks\HookEvent; use App\Models\EmailMarketingSubscriber; class SubscriberUnsubscribed extends HookEvent { public const HOOK = 'SubscriberUnsubscribed'; public function subscriberId(): ?int { $id = $this->get('subscriber_id'); return $id ? (int) $id : null; } public function subscriber(): ?EmailMarketingSubscriber { $id = $this->subscriberId(); return $id ? EmailMarketingSubscriber::find($id) : null; } public function email(): ?string { return $this->get('email'); } } 