filamentphp/filament · error · LogicException

Model [{$userClass}] does not have a [notify()] method.

Error message

Model [{$userClass}] does not have a [notify()] method.

What it means

Error "Model [{$userClass}] does not have a [notify()] method." thrown in filamentphp/filament.

Source

Thrown at packages/panels/src/Auth/MultiFactor/Email/EmailAuthentication.php:68

    public function isEnabled(Authenticatable $user): bool
    {
        if (! ($user instanceof HasEmailAuthentication)) {
            throw new LogicException('The user model must implement the [' . HasEmailAuthentication::class . '] interface to use email authentication.');
        }

        return $user->hasEmailAuthentication();
    }

    public function sendCode(HasEmailAuthentication $user): bool
    {
        if (! ($user instanceof Model)) {
            throw new LogicException('The [' . $user::class . '] class must be an instance of [' . Model::class . '] to use email authentication.');
        }

        if (! method_exists($user, 'notify')) {
            $userClass = $user::class;

            throw new LogicException("Model [{$userClass}] does not have a [notify()] method.");
        }

        $rateLimitingKey = "filament-email-authentication:{$user->getKey()}";

        if (RateLimiter::tooManyAttempts($rateLimitingKey, maxAttempts: 2)) {
            return false;
        }

        RateLimiter::hit($rateLimitingKey);

        $code = $this->generateCode();
        $codeExpiryMinutes = $this->getCodeExpiryMinutes();

        session()->put($this->getCodeSessionKey($user), Hash::make($code));
        session()->put($this->getCodeExpirySessionKey($user), now()->addMinutes($codeExpiryMinutes));

        $user->notify(app($this->getCodeNotification(), [
            'code' => $code,

View on GitHub (pinned to 53483fa934)

When it happens

Trigger: Thrown at packages/panels/src/Auth/MultiFactor/Email/EmailAuthentication.php:68 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of filamentphp/filament@53483fa934 (2026-08-17). Data as JSON: /api/errors/e3574316c184735f. Report an issue: GitHub.