ThrottleRequests
class ThrottleRequests (View source)
Свойства
| protected RateLimiter | $limiter | Экземпляр лимитера. |
Методы
| void | __construct(RateLimiter $limiter) Создать новый лимитер запросов. | |
| mixed | handle(Request $request, Closure $next, int $maxAttempts = 60, float|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, float|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.4/Illuminate/Routing/Middleware/ThrottleRequests.html