aporat/laravel-rate-limiter
Add flexible rate limiting to Laravel routes and APIs with aporat/laravel-rate-limiter. Configure request limits, time windows, and custom keys, then protect endpoints via middleware using Laravel’s cache-backed storage. Ideal for throttling login attempts, webhooks, and public APIs.
REDIS_URL, Octane safety, and framework events is likely cheaper and lower-risk than building distributed multi-window limiting in-house unless requirements are highly custom.X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset) and new Retry-After on 429s are product-visible. This drives decisions on API documentation, SDK compatibility, and client retry behavior.on_redis_failure (open / closed → 503) with backoff lets product teams choose between availability and strict enforcement during Redis incidents. This should be an explicit product risk decision, not an infrastructure default.10.0.0.0/8 to loopback only closes a serious bypass behind load balancers. This supports decisions on secure-by-default configuration and review of proxy/trusted-IP assumptions.RateLimitExceeded and IpBlocked events, plus reduced 429 error logging, enable alerting and analytics without flooding logs with request input/headers.ext-redis align the limiter with current Laravel/PHP support and either phpredis or predis. This affects upgrade timing and platform roadmap.RateLimit::with().rate.limiter:60,1 or named windows (second=, minute=, hourly=, daily=) and key strategies like IP, user, route, or combinations.REDIS_URL, phpredis or predis, and needing configuration that does not leak request state across workers.withRateLimitHeaders(), setRequestTag(), getRequestTag(), checkIpAddress()), removed redis.* connection settings, changed whitelist/default logging behavior, and middleware parameter validation. If a near-term upgrade is not feasible, defer adoption until the platform upgrade is scheduled.REDIS_URL, makes builders immutable, and adds middleware parameters, events, LimitResult, RateLimiter::attempt(), and blockedFor(). It requires PHP 8.3+, renames headers, removes legacy methods/settings, and changes defaults to safer values.How can I help you explore Laravel packages today?