Documentation: https://hypervel.org/docs/rate-limiting
- Hypervel provides rate limiting through the dedicated
hypervel/rate-limiterpackage andHypervel\RateLimiternamespace instead of Laravel's Cache component. - Hypervel uses immutable, typed rate limits.
Limitdefines a fixed window,CalendarWindowdefines a window that resets at the start of each minute, hour, day or month,SlidingWindowdefines a weighted sliding window,LeakyBucketdefines a GCRA-backed leaky bucket,Unlimitedbypasses storage, andBackoffdefines failure-driven exponential delays. Useglobally()instead of Laravel'sGlobalLimitclass. - The
consume,consumeMany,inspect,attempt,recordFailure, andclearmethods replace Laravel's split primitive counter API. - Rate limit keys are always hashed and include the rate limit type, its stable algorithm settings, and its global scope. Cost and callbacks do not affect identity. Changing identity settings starts new state, and
clear()must receive the same settings that created the state. - Weighted denials report the actual unused capacity. The
attempt()method consumes before invoking its callback and retains the charge if the callback throws. - Redis is selected through the normal rate limiter store API. Hypervel does not provide Redis-specific routing or queue middleware classes, a
throttleWithRedis()switch, aredisargument onMiddleware::throttleApi(), or a way to disable key hashing.