ThrottleRequests
class ThrottleRequests (View source)
Свойства
| protected RateLimiter | $limiter | Экземпляр ограничителя скорости. |
Методы
| void | __construct(RateLimiter $limiter) Создать новый ограничивает запросы. | |
| mixed | handle(Request $request, Closure $next, int $maxAttempts = 60, int $decayMinutes = 1) Обработать входящий запрос. | |
| string | resolveRequestSignature(Request $request) Выделить подпись запроса. | |
| Response | buildResponse(string $key, int $maxAttempts) Создать ответ 'слишком много попыток'. | |
| Response | addHeaders(Response $response, int $maxAttempts, int $remainingAttempts, int|null $retryAfter = null) Добавить информацию о лимитах в предоставленный ответ. | |
| int | calculateRemainingAttempts(string $key, int $maxAttempts, int|null $retryAfter = null) Вычислить количество оставшихся попыток. |
Подробности
void __construct(RateLimiter $limiter)
Создать новый ограничивает запросы.
mixed handle(Request $request, Closure $next, int $maxAttempts = 60, int $decayMinutes = 1)
Обработать входящий запрос.
protected string resolveRequestSignature(Request $request)
Выделить подпись запроса.
protected Response buildResponse(string $key, int $maxAttempts)
Создать ответ 'слишком много попыток'.
protected Response addHeaders(Response $response, int $maxAttempts, int $remainingAttempts, int|null $retryAfter = null)
Добавить информацию о лимитах в предоставленный ответ.
protected int calculateRemainingAttempts(string $key, int $maxAttempts, int|null $retryAfter = null)
Вычислить количество оставшихся попыток.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Routing/Middleware/ThrottleRequests.html