symfony/rate-limiter
Symfony Rate Limiter provides token bucket rate limiting for your app. Create limiters with RateLimiterFactory and a storage backend (e.g., in-memory), then reserve tokens with blocking waits or consume instantly to allow/skip work based on availability.
calendar-aligned fixed window) alongside the existing token bucket. This mode aligns with time-based windows (e.g., "100 requests per hour, starting at the top of the hour"), improving predictability for scheduled workloads (e.g., cron jobs, batch processing). The fix in v8.1.0-BETA3 (#64294) hardens this mode, addressing edge cases where window boundaries could cause inconsistent counting across distributed systems.CompoundRateLimiterFactory now supports mixing token bucket and fixed window policies, enabling complex scenarios (e.g., "100 requests/hour for batch jobs AND 10 requests/second for APIs").Retry-After headers remain RFC 6585-compliant; no regressions.RateLimiterMiddleware; existing token bucket policies continue to work unchanged.Job::handle()) can now use fixed window mode for scheduled jobs, improving alignment with cron-like workflows.php artisan schedule:run).RateLimiter::createCompound([$tokenBucketPolicy, $fixedWindowPolicy])).app()->singleton) to reduce overhead?Job::handle()) with new fixed window support for scheduled jobs.Retry-After headers; no regressions.RateLimiterFactory as a singleton/contextual binding; fixed window mode is opt-in./api/webhooks, /api/batch) for pilot testing./api/import) with fixed window mode.RateLimiterMiddleware for token bucket; add fixed window policies for batch endpoints.Job::handle() for scheduled jobs; verify window alignment.php artisan schedule:run) with fixed window mode.composer require symfony/rate-limiter:^8.1).config/rate_limits.php.throttle with RateLimiterMiddleware (token bucket only).config/rate_limits.php or env vars.RateLimiter::getTokensLeft() (token bucket) or RateLimiter::getRemainingRequests() (fixed window)How can I help you explore Laravel packages today?