Laravel 預設的 throttle middleware 只有在 api 的 route 有統一加上,如果 web route 想用的話也可以自行加入。 例如: 10 分鐘只能連線 5 次 。 全部的 web route 都加。 protected $middlewareGroups = [ 'web' => [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, // \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, 'throttle:5,10', ], 'api' => [ 'throttle:60,1', 'bindings', ], ]; 特定的 route group 才加。 Route::group(['middleware' => 'throttle:5,10'], function () { Route::get('/testThrottle', function () { return 'ok'; })->middleware('throttle:5,10'); }); 特定...