9

Can we disable the laravel's throttle in a specific group of routes?

Here are my codes:

Route::group(['middleware' => ['auth:sanctum']], function () {
    Route::get('/sample1', 'SampleController@sample');
    // more routes here
});

I want to disable throttle limiter in all routes wrap inside Route::group. Can we possibly do that?

1 Answer 1

9

If you are using Latest laravel version then you disable throtle for specific route group.

You can exclude throttle:api middleware for specific route group using excluded_middleware

Route::group([
'middleware' => ['auth:sanctum'],
'excluded_middleware' => 'throttle:api'], function () {
      Route::get('/sample1', 'SampleController@sample');
    });
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.