Skip to content

Dynamic ThrottleRate limits you change while your Laravel app runs

Per IP, user, API token, header or tenant, with dry-run, exemptions, emergency switches and a dashboard. Now in public beta.

The dashboard's Overview page: health, the rules, blocks and would-blocks in the last hour, a traffic chart, and the emergency controls.
A limit changing while the app runs. On the left, a terminal loops curl against /api/orders, and every response is 200. On the right, the dashboard edits the Orders API rule: its limit goes from 100 to 2 requests a minute, and it is saved. Within two seconds, the terminal's responses turn to 429 Too Many Requests, with no deploy.

Why ​

Laravel's throttle middleware works for limits you know up front. In production, you learn the right limits later, and in a hurry: a partner's integration starts getting 429s, a bot hammers /login at 2 a.m., or you want a stricter limit without knowing who it would block. With throttle, each fix is a code change and a deploy, and you still can't see who is blocked.

Dynamic Throttle makes limits data. Rules live in your database, you change them from a dashboard, Artisan or code, and every server applies the change within seconds.

You want toLaravel's throttleDynamic Throttle
Change a limitEdit code and deployEdit the rule; servers apply it within 2 seconds
Try a limit before it blocks anyoneNot possibleDry-run: the rule counts, never blocks, and reports who it would block
See who is blockedAdd your own loggingA live feed, and each rule's top offenders
Let a partner or a user throughA code changeAn exemption, with an end date
Lift every limit during an incidentA deploydynamic-throttle:bypass on --for=30m, which ends by itself
Limit per tenant or planA custom limiter closureA custom scope and one rule
Know why a request was blockedRead the codeThe Explain page, or dynamic-throttle:explain
Keep serving when Redis is downAn exception per requestRequests go through, or get a 503 on the rules you choose

Requests never read the rules from the database: they are compiled into your cache. On local Redis, the middleware adds about 0.8 ms per request at p50 with APCu, against 1.0 ms for Laravel's throttle and 0.6 ms for its throttleWithRedis() (performance). It is not a firewall or bot detection, and it does not replace edge rate limiting such as Cloudflare or Nginx. Use it for limits that need to know who the client is.

Released under the MIT License. An independent package, not affiliated with or endorsed by Laravel.