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

242Studios's avatar

Throttle API Routes

Hey,

I'd like to rate limit my Laravel API but I have a question. If I use the throttle middleware for a route to prevent too many attempts at a time from the same IP address, is the IP address it's using to make that determination the IP address of my front end? Or is it using the IP address of the user making requests from my front end?

For example, if I use 'throttle:3,10', does that mean if four users utilize my front end application within the space of 10 minutes, one of them will be blocked?

0 likes
3 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

It uses the ip of the person making the request. Your frontend is running in their browser

1 like
242Studios's avatar

Awesome. So just to be extra clear, throttling the API route would only be based on the amount of times an individual user has tried to hit that route and not the app itself?

Sinnbeck's avatar

@cthronebury@gmail.com correct. As long as you attach it to a route. And a user can be a whole company as they share ip

1 like

Please or to participate in this conversation.