Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| LoginController | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| maxAttempts | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| decayMinutes | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Http\Controllers\Auth; |
| 4 | |
| 5 | use App\Http\Controllers\Controller; |
| 6 | use App\Providers\RouteServiceProvider; |
| 7 | use Illuminate\Foundation\Auth\AuthenticatesUsers; |
| 8 | |
| 9 | class LoginController extends Controller |
| 10 | { |
| 11 | /* |
| 12 | |-------------------------------------------------------------------------- |
| 13 | | Login Controller |
| 14 | |-------------------------------------------------------------------------- |
| 15 | | |
| 16 | | This controller handles authenticating users for the application and |
| 17 | | redirecting them to your home screen. The controller uses a trait |
| 18 | | to conveniently provide its functionality to your applications. |
| 19 | | |
| 20 | */ |
| 21 | |
| 22 | use AuthenticatesUsers; |
| 23 | |
| 24 | /** |
| 25 | * Where to redirect users after login. |
| 26 | * |
| 27 | * @var string |
| 28 | */ |
| 29 | protected $redirectTo = RouteServiceProvider::DASHBOARD; |
| 30 | |
| 31 | /** |
| 32 | * Create a new controller instance. |
| 33 | * |
| 34 | * @return void |
| 35 | */ |
| 36 | public function __construct() |
| 37 | { |
| 38 | $this->middleware('guest')->except('logout'); |
| 39 | } |
| 40 | |
| 41 | /** Failed attempts before lock-out (config/auth.php → throttle). */ |
| 42 | public function maxAttempts(): int |
| 43 | { |
| 44 | return (int) config('auth.throttle.max_attempts', 5); |
| 45 | } |
| 46 | |
| 47 | /** Lock-out length in minutes. */ |
| 48 | public function decayMinutes(): int |
| 49 | { |
| 50 | return (int) config('auth.throttle.decay_minutes', 1); |
| 51 | } |
| 52 | } |