How to apply different rate limit on API endpoints.
I want to apply different rate limits to different API endpoints. For example, the api/orders endpoint should have a rate limit of 60, while the api/request endpoint should have a rate limit of 100.
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->IP());
});
@tisuchi Thanks for your answer. How about the other generic endpoints that belong to the API as well, such as api/settings, api/users, api/icons, and api/response? How should we handle those? Do we need to target each API route individually, or can we write a generic one that covers them all, remaining ones?