input('email'); if (! is_string($email) || $email === '') { return; } $key = $this->rateLimitKey($email); if (RateLimiter::tooManyAttempts($key, $this->rateLimitMaxAttempts())) { $validator->errors()->add( 'email', trans($this->rateLimitMessageKey()) ); } } public function hitEmailRateLimit(): void { $email = $this->input('email'); if (! is_string($email) || $email === '') { return; } if (! app()->environment('local')) { RateLimiter::hit($this->rateLimitKey($email), $this->rateLimitDecaySeconds()); } } private function rateLimitKey(string $email): string { return "{$this->rateLimitPrefix()}:" . strtolower($email); } }