check()) { redirect()->intended(Filament::getUrl()); } $this->form->fill(); } public function authenticate(): ?LoginResponse { try { $this->rateLimit(5); } catch (TooManyRequestsException $exception) { throw ValidationException::withMessages([ 'email' => __('filament::login.messages.throttled', [ 'seconds' => $exception->secondsUntilAvailable, 'minutes' => ceil($exception->secondsUntilAvailable / 60), ]), ]); } $data = $this->form->getState(); if (! Filament::auth()->attempt([ 'email' => $data['email'], 'password' => $data['password'], ], $data['remember'])) { throw ValidationException::withMessages([ 'email' => __('filament::login.messages.failed'), ]); } session()->regenerate(); return app(LoginResponse::class); } protected function getFormSchema(): array { return [ TextInput::make('email') ->label(__('filament::login.fields.email.label')) ->email() ->required() ->autocomplete(), TextInput::make('password') ->label(__('filament::login.fields.password.label')) ->password() ->required(), Checkbox::make('remember') ->label(__('filament::login.fields.remember.label')), ]; } public function render(): View { return view('filament::login') ->layout('filament::components.layouts.card', [ 'title' => __('filament::login.title'), ]); } }