validate(); $this->ensureIsNotRateLimited(); if (! Auth::attempt(['email' => $this->email, 'password' => $this->password], $this->remember)) { RateLimiter::hit($this->throttleKey()); throw ValidationException::withMessages([ 'email' => __('auth.failed'), ]); } RateLimiter::clear($this->throttleKey()); session()->regenerate(); return redirect()->intended(route('dashboard')); } protected function ensureIsNotRateLimited(): void { if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) { return; } throw ValidationException::withMessages([ 'email' => __('auth.throttle', ['seconds' => RateLimiter::availableIn($this->throttleKey())]), ]); } protected function throttleKey(): string { return Str::transliterate(Str::lower($this->email).'|'.request()->ip()); } public function render() { return view('livewire.auth.login'); } }