Syntax ': value' in the array

3

I've seen this syntax in laravel, in the 'resources / lang' area, where authentication messages are pre-configured. And I came across the following code:

<?php

return [

   'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',

];

Where is written ': seconds', I would like to know where this value comes from and how to display it correctly.

    
asked by anonymous 20.03.2018 / 18:54

1 answer

0

Inside app \ Http \ Controllers \ Auth \ LoginController.php Add this override method

 /**
 * Determina a quantidade de tentativas de acesso caso a senha esteja errada
 * 6 Tentativas por 30 minutos
 * @param  \Illuminate\Http\Request  $request
 * @return bool
 */
protected function hasTooManyLoginAttempts(Request $request)
{
    return $this->limiter()->tooManyAttempts(
        $this->throttleKey($request), 6, 30 
    );
}

This value comes from Laravel's CORE, this method above serves to override the default code. If you are using AUTH correctly within Laravel, this message will be displayed automatically, and the value to be displayed will match what you have edited. This structure is for you to be able to add translation packages within your project.

Here's a repository to help with the translation of your project.

link

    
20.03.2018 / 20:17