<?php

namespace App\EventHooks\Client;

use App\EventHooks\HookEvent;
use App\Models\User;

/**
 * Fire noktası: UserObserver::updated, email_verified_at ilk kez set edilince.
 * Context: userId/user_id (model KONMAZ — yalnız id).
 */
class UserEmailVerified extends HookEvent
{
    public const HOOK = 'UserEmailVerificationComplete';

    public function user(): ?User
    {
        $id = $this->get('user_id') ?? $this->get('userId') ?? $this->get('userid');

        return $id ? User::find($id) : null;
    }
}
