Unlimited
class Unlimited extends GlobalLimit (View source)
Properties
mixed|string | $key | The rate limit signature key. |
from Limit |
int | $maxAttempts | The maximum number of attempts allowed within the given number of minutes. |
from Limit |
int | $decayMinutes | The number of minutes until the rate limit is reset. |
from Limit |
callable | $responseCallback | The response generator callback. |
from Limit |
Methods
void
__construct()
Create a new limit instance.
static Limit
perMinutes(int $decayMinutes, int $maxAttempts)
Create a new rate limit using minutes as decay time.
from
Limit
static Limit
perHour(int $maxAttempts, int $decayHours = 1)
Create a new rate limit using hours as decay time.
from
Limit
Details
void
__construct()
Create a new limit instance.
in
Limit at line 56
static Limit
perMinute(int $maxAttempts)
Create a new rate limit.
in
Limit at line 68
static Limit
perMinutes(int $decayMinutes, int $maxAttempts)
Create a new rate limit using minutes as decay time.
in
Limit at line 80
static Limit
perHour(int $maxAttempts, int $decayHours = 1)
Create a new rate limit using hours as decay time.
in
Limit at line 92
static Limit
perDay(int $maxAttempts, int $decayDays = 1)
Create a new rate limit using days as decay time.
in
Limit at line 102
static Limit
none()
Create a new unlimited rate limit.
in
Limit at line 113
$this
by(string $key)
Set the key of the rate limit.
in
Limit at line 126
$this
response(callable $callback)
Set the callback that should generate the response when the limit is exceeded.