Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

yatensaini's avatar

Throttle Disabled for API

When a user is hitting same API continuously 4-5 time then api route redirect on 404 error page. How to disable ThrottleRequest and throttle middleware to allow user hit continously same api.

0 likes
5 replies
grenadecx's avatar

Inside app/http/kernel.php you have the middleware, you should be able to remove the throttle from the middleware groups to accomplish this.

niseku's avatar

The throttle middleware does not throw a 404 status code. If the request is blocked by the throttling middleware you receive a 429 (Too Many Requests) status code.

Do you use route models on this route?

yatensaini's avatar

if i use throttle middleware then it give me Too Many Attempts and 429 (Too Many Requests) status code and if i don't use this middleware and use direct api route then it redirect me 404 page.

niseku's avatar

Please post the code of your route and your controller

Please or to participate in this conversation.