I need to setup different rate limits for different paths. Foe example:
On path /users I want to have rate limit of 60 requests per minute, while for path /stats I want to have rate limit of only 5 requests per minute.
I tried with next approach
Route::group(['middleware' => ['auth', 'throttle:60']], function(){
Route::get('users', 'User@list');
});
Route::group(['middleware' => ['auth', 'throttle:5']], function(){
Route::get('stats', 'User@stats');
});
Somehow, last rate limit is applied. However, when making requests on users path, X-Rate-Limit-Limit header is set to 60, but it throws "Too many requests" error when it reaches 6th request.