class RateLimiter (View source)
InteractsWithTime |
protected Repository | $cache | The cache store implementation. | |
protected array | $limiters | The configured limit object resolvers. |
int | secondsUntil(DateTimeInterface|DateInterval|int $delay) Get the number of seconds until the given DateTime. | from InteractsWithTime |
int | availableAt(DateTimeInterface|DateInterval|int $delay = 0) Get the "available at" UNIX timestamp. | from InteractsWithTime |
DateTimeInterface|int | parseDateInterval(DateTimeInterface|DateInterval|int $delay) If the given value is an interval, convert it to a DateTime instance. | from InteractsWithTime |
int | currentTime() Get the current system time as a UNIX timestamp. | from InteractsWithTime |
void | __construct(Repository $cache) Create a new rate limiter instance. | |
$this | for(string $name, Closure $callback) Register a named limiter configuration. | |
Closure | limiter(string $name) Get the given named rate limiter. | |
bool | tooManyAttempts(string $key, int $maxAttempts) Determine if the given key has been "accessed" too many times. | |
int | hit(string $key, int $decaySeconds = 60) Increment the counter for a given key for a given decay time. | |
mixed | attempts(string $key) Get the number of attempts for the given key. | |
mixed | resetAttempts(string $key) Reset the number of attempts for the given key. | |
int | retriesLeft(string $key, int $maxAttempts) Get the number of retries left for the given key. | |
void | clear(string $key) Clear the hits and lockout timer for the given key. | |
int | availableIn(string $key) Get the number of seconds until the "key" is accessible again. |
Get the number of seconds until the given DateTime.
Get the "available at" UNIX timestamp.
If the given value is an interval, convert it to a DateTime instance.
Get the current system time as a UNIX timestamp.
Create a new rate limiter instance.
Register a named limiter configuration.
Get the given named rate limiter.
Determine if the given key has been "accessed" too many times.
Increment the counter for a given key for a given decay time.
Get the number of attempts for the given key.
Reset the number of attempts for the given key.
Get the number of retries left for the given key.
Clear the hits and lockout timer for the given key.
Get the number of seconds until the "key" is accessible again.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/8.x/Illuminate/Cache/RateLimiter.html