{"record":{"id":"dca5d3deededc405","repo":"filamentphp/filament","slug":"the-user-model-must-implement-the-filament-auth-m-dca5d3","errorCode":null,"errorMessage":"The user model must implement the [Filament\\Auth\\MultiFactor\\Email\\Contracts\\HasEmailAuthentication] interface to use email authentication.","messagePattern":"The user model must implement the \\[Filament\\\\Auth\\\\MultiFactor\\\\Email\\\\Contracts\\\\HasEmailAuthentication\\] interface to use email authentication\\.","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"packages/panels/src/Auth/MultiFactor/Email/EmailAuthentication.php","lineNumber":53,"sourceCode":"    public static function make(): static\n    {\n        return app(static::class);\n    }\n\n    public function getId(): string\n    {\n        return 'email_code';\n    }\n\n    public function getLoginFormLabel(): string\n    {\n        return __('filament-panels::auth/multi-factor/email/provider.login_form.label');\n    }\n\n    public function isEnabled(Authenticatable $user): bool\n    {\n        if (! ($user instanceof HasEmailAuthentication)) {\n            throw new LogicException('The user model must implement the [' . HasEmailAuthentication::class . '] interface to use email authentication.');\n        }\n\n        return $user->hasEmailAuthentication();\n    }\n\n    public function sendCode(HasEmailAuthentication $user): bool\n    {\n        if (! ($user instanceof Model)) {\n            throw new LogicException('The [' . $user::class . '] class must be an instance of [' . Model::class . '] to use email authentication.');\n        }\n\n        if (! method_exists($user, 'notify')) {\n            $userClass = $user::class;\n\n            throw new LogicException(\"Model [{$userClass}] does not have a [notify()] method.\");\n        }\n\n        $rateLimitingKey = \"filament-email-authentication:{$user->getKey()}\";","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/filamentphp/filament/blob/53483fa9340e4ec637985fe454ebb58afb92ea24/packages/panels/src/Auth/MultiFactor/Email/EmailAuthentication.php#L35-L71","documentation":"Error \"The user model must implement the [Filament\\Auth\\MultiFactor\\Email\\Contracts\\HasEmailAuthentication] interface to use email authentication.\" thrown in filamentphp/filament.","triggerScenarios":"Thrown at packages/panels/src/Auth/MultiFactor/Email/EmailAuthentication.php:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53483fa9340e4ec637985fe454ebb58afb92ea24","analyzedAt":"2026-08-17T02:06:23.049Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}