throttleをルートごとに別々にかける

refs #474
This commit is contained in:
shibafu 2020-08-20 20:48:29 +09:00
parent d0fcbd79ca
commit 59e4cb8d91
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,6 @@ class Kernel extends HttpKernel
],
'api' => [
'throttle:60,1',
\App\Http\Middleware\EnforceJson::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],

View File

@ -15,9 +15,10 @@
// return $request->user();
//});
Route::get('/checkin/card', 'Api\\CardController@show');
Route::get('/checkin/card', 'Api\\CardController@show')
->middleware('throttle:180,1,card');
Route::middleware(['stateful', 'auth'])->group(function () {
Route::middleware(['throttle:60,1', 'stateful', 'auth'])->group(function () {
Route::post('/likes', 'Api\\LikeController@store');
Route::delete('/likes/{id}', 'Api\\LikeController@destroy');
});