Spec-Zone.ru › Laravel 5.4

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)

Создать новый лимитер запросов.

Параметры

RateLimiter $limiter

Возвращаемое значение

void

mixed handle(Request $request, Closure $next, int $maxAttempts = 60, float|int $decayMinutes = 1)

Обработать входящий запрос.

Параметры

Request $request
Closure $next
int $maxAttempts
float|int $decayMinutes

Возвращаемое значение

mixed

protected string resolveRequestSignature(Request $request)

Выполнить разрешение подписи запроса.

Параметры

Request $request

Возвращаемое значение

string

protected Response buildResponse(string $key, int $maxAttempts)

Создать ответ 'слишком много попыток'.

Параметры

string $key
int $maxAttempts

Возвращаемое значение

Response

protected Response addHeaders(Response $response, int $maxAttempts, int $remainingAttempts, int|null $retryAfter = null)

Добавить информацию о лимите в заголовки данного ответа.

Параметры

Response $response
int $maxAttempts
int $remainingAttempts
int|null $retryAfter

Возвращаемое значение

Response

protected int calculateRemainingAttempts(string $key, int $maxAttempts, int|null $retryAfter = null)

Вычислить оставшееся количество попыток.

Параметры

string $key
int $maxAttempts
int|null $retryAfter

Возвращаемое значение

int

© 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

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API