jacyimp/api-platform-rate-limiter
A Laravel/PHP rate limiter for API platforms, providing middleware-driven request throttling to protect endpoints and control traffic. Lightweight, easy to integrate, and configurable to fit existing API stacks.
RateLimit entries now compose naturally, so a single endpoint can carry a burst cap (100/min), an hourly cap (1,000/hr) and a daily cap (10,000/day) declaratively. That maps directly onto plan tiers, trial limits and abuse ceilings without custom throttling code — a pricing/packaging decision you can now make in the resource definition rather than in a service layer.symfony/security-core optional: authenticated users are limited by user identity when Security is present, otherwise the package falls back to client IP. This is the decision that determines who gets billed for overage and how you answer "why was I throttled?" support tickets. It must be settled before quotas are published externally.DynamicLimit, DynamicCost, DynamicBucket, Identity, Condition), the Interval value object and the RateLimitChecking event. Any roadmap item that assumed a stable limits API should carry an explicit migration workstream before more limits are layered on.RateLimitChecking removes the in-package hook teams commonly use for throttle telemetry. This forces a deliberate decision on where throttle metrics/alerts live (middleware, exception handler, or gateway) rather than inheriting it.Consider it when:
Look elsewhere or defer when:
Executive summary. This gives us declarative, in-code rate limits on our API endpoints, including stacked burst/hourly/daily caps and tenant-aware buckets — the mechanics behind tiered plans and abuse protection, without building a throttling subsystem. It is early-stage (0.x) and this release is intentionally breaking. Recommendation: adopt narrowly behind a pinned version for one or two endpoints, not as a platform-wide dependency, and revisit at 1.0.
Engineering. Less boilerplate: limits live with the resource and compose instead of overriding. Cost of upgrade: removed dynamic/identity/condition abstractions must be rewritten as typed resolver class names and an explicit bucketResolver; Interval becomes strings or DateInterval; the RateLimitChecking event must be replaced with middleware or exception-handler instrumentation. Budget a focused migration plus re-baselining of every existing quota, since resource and operation limits now add together rather than replace.
Product and Finance. We gain the ability to sell tiered limits and defend capacity with configuration rather than code. Two caveats to resolve before publishing anything customer-facing: (1) effective limits may change for existing endpoints purely from the composition change, and (2) identity falls back to client IP when Symfony Security isn't installed, which changes who is accountable for overage. Both need confirmation per environment before quotas appear in a contract or pricing page.
Risk and communications. Quota semantics are customer-facing; treat any future release that alters composition the same way as a pricing change — comms, docs and support scripts updated together. The release notes already correct misleading tenant quota documentation, which tells us the documentation is still stabilising: do not let it be the sole source of truth for published limits.
How can I help you explore Laravel packages today?