How to disable throttle in specific routes? (laravel)
Asked Answered
K

1

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?

Kandykane answered 16/6, 2021 at 3:44 Comment(0)
A
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');
    });
Alyciaalyda answered 16/6, 2021 at 5:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.