email = trim($this->email); $this->validate( ['email' => ['required', 'string', 'email'], 'password' => ['required', 'string']], [ 'email.required' => __('auth.email_required'), 'email.email' => __('auth.email_invalid'), 'password.required' => __('auth.password_required'), ], ); $email = Str::lower(trim($this->email)); $throttleKey = Str::transliterate($email.'|'.request()->ip()); if (RateLimiter::tooManyAttempts($throttleKey, self::MAX_ATTEMPTS_PER_MINUTE)) { throw ValidationException::withMessages([ 'email' => __('auth.throttle', ['seconds' => RateLimiter::availableIn($throttleKey)]), ]); } $accountDisabled = false; $signedIn = Auth::attemptWhen( ['email' => $email, 'password' => $this->password], function ($user) use ($checkLoginAllowed, &$accountDisabled): bool { $accountDisabled = ! $checkLoginAllowed->execute($user->getAuthIdentifier()); return ! $accountDisabled; }, $this->remember, ); if (! $signedIn) { RateLimiter::hit($throttleKey); $this->reset('password'); throw ValidationException::withMessages([ 'email' => __($accountDisabled ? 'auth.account_disabled' : 'auth.failed'), ]); } RateLimiter::clear($throttleKey); session()->regenerate(); $this->redirectIntended(route('home')); } public function render(): mixed { return $this->view()->title(__('auth.login_title')); } }; ?>
{{ __('auth.login_title') }} @if (session('status')) @endif
{{ __('auth.login') }} {{ __('auth.forgot_password') }}