在我的 Laravel 项目中 这两个查询正在关于我的路线中间件的任何地方执行,我需要在某些路线上跳过它们,我该怎么做
我尝试在内核中创建“withoutThrottle”中间件,如下所示
但它不起作用
您可以通过将路线分组到
api.php
中来跳过路线,例如:
Route::wihtouMiddleware(['throttle:api'])->group(function () {
Route::post('/x', function () {
// ...
});
Route::post('/y', function () {
// ...
});
});
或单一路线:
Route::post('/x', function () {
// ...
})->wihtouMiddleware(['throttle:api']);