perimeter/rate-limiter-php
A lightweight PHP rate-limiting library from Perimeter for controlling request throughput across APIs and endpoints. Define limits and time windows to prevent abuse, smooth traffic spikes, and protect application resources with a straightforward, consistent API.
RateLimiter facade and ThrottleRequests middleware, Symfony's RateLimiter component), API gateway/edge, or an application library. This package is nominally "buy" (MIT, zero license cost) but carries full maintenance cost, so it competes poorly against primitives already in the stack.Consider it only when all of the following hold:
Look elsewhere if:
X-RateLimit-* / Retry-After headers, or per-route policy composition.To executives: Rate limiting is a revenue and reliability control, not a library choice. It lets us enforce plan tiers, protect margins on metered and third-party costs, and blunt abuse — all things the business already depends on. We can deliver that using components already in our stack at zero license cost. Adopting an unmaintained 2015 package adds security exposure and an ongoing maintenance owner without adding any capability we lack. Recommendation: no new dependency. Implement on framework-native primitives or at the API gateway, instrument it, and tie thresholds to plan tiers so limits become a visible, sellable product surface rather than an invisible guardrail.
To engineering: Treat perimeter/rate-limiter-php as a reference implementation at best — the algorithm ideas are sound, the maintenance posture is not. If we ever touch it, we vendor it, pin the version, add tests, and accept ownership. Otherwise: framework middleware backed by Redis for atomicity, standard rate-limit headers in responses, metrics on 429s, and limits expressed as configuration so product can tune them without a deploy.
How can I help you explore Laravel packages today?