En mi
resources/lang/en/auth.php
tengo esto
<?php return [ /* |-------------------------------------------------------------------------- | Authentication Language Lines |-------------------------------------------------------------------------- | | The following language lines are used during authentication for various | message that we need to display to the user. You are free to modify | these language lines according to your application's requirements. | */ 'failed' => 'These credentials do not match our records.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', ]; ¿Hay alguna manera de editar el acelerador :seconds a una hora?
el mensaje de error en el frente sería algo como esto
Too many login attempts. Please try again in 2 hour(s).
De forma predeterminada, el rasgo de inicio de sesión del acelerador solo proporciona minutes y seconds , si desea agregar horas, simplemente anule el método sendLockoutResponse de Illuminate\Foundation\Auth\ThrottlesLogins como a continuación (en LoginController que usa el rasgo AuthenticatesUsers ):
/** * Redirect the user after determining they are locked out. * * @param \Illuminate\Http\Request $request * @return void * * @throws \Illuminate\Validation\ValidationException */ protected function sendLockoutResponse(Request $request) { $seconds = $this->limiter()->availableIn( $this->throttleKey($request) ); throw ValidationException::withMessages([ $this->username() => [trans('auth.throttle', [ 'seconds' => $seconds, 'minutes' => ceil($seconds / 60), 'hours' => ceil($seconds / 60 / 60), ])], ])->status(Response::HTTP_TOO_MANY_REQUESTS); }Ahora puede agregar aceleradores de horas como se muestra a continuación:
'throttle' => 'Too many login attempts. Please try again in :hours hour(s).',