filamentphp/filament · error · LogicException

The [{class}] class must be an instance of [Illuminate\Datab

Error message

The [{class}] class must be an instance of [Illuminate\Database\Eloquent\Model] to use email authentication.

What it means

Error "The [{class}] class must be an instance of [Illuminate\Database\Eloquent\Model] to use email authentication." thrown in filamentphp/filament.

Source

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

    public function getLoginFormLabel(): string
    {
        return __('filament-panels::auth/multi-factor/email/provider.login_form.label');
    }

    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();

View on GitHub (pinned to 53483fa934)

When it happens

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

Common situations: See trigger scenarios.

Understand the failure class


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