| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 8 | class ThrottleRequestsService { |
||
| 9 | use AuthenticatesUsers; |
||
|
|
|||
| 10 | |||
| 11 | public $maxAttempts = 5; // change to the max attempt you want. |
||
| 12 | public $delayMinutes = 1; |
||
| 13 | |||
| 14 | public function __construct(int $maxAttempts = 5, int $delayMinutes = 1) |
||
| 15 | { |
||
| 16 | $this->maxAttempts = $maxAttempts; |
||
| 17 | $this->delayMinutes = $delayMinutes; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function hasTooManyAttempts (Request $request) |
||
| 21 | { |
||
| 22 | return $this->hasTooManyLoginAttempts($request); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function incrementAttempts (Request $request) |
||
| 26 | { |
||
| 27 | return $this->incrementLoginAttempts($request); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function clearAttempts (Request $request) |
||
| 31 | { |
||
| 32 | return $this->clearLoginAttempts($request); |
||
| 33 | } |
||
| 34 | |||
| 35 | public function _fireLockoutEvent (Request $request) |
||
| 36 | { |
||
| 37 | return $this->fireLockoutEvent($request); |
||
| 38 | } |
||
| 39 | |||
| 40 | public function _limiter () |
||
| 43 | } |
||
| 44 | |||
| 45 | public function _throttleKey (Request $request) |
||
| 48 | } |
||
| 49 | } |
||
| 50 |