From b9ce852cd3d5531053c0e22d9ff1c6b31d7d791e Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 9 Jul 2018 20:01:35 +0200 Subject: Throtteling for API --- routes/api.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'routes/api.php') diff --git a/routes/api.php b/routes/api.php index c641ca5..a349a47 100644 --- a/routes/api.php +++ b/routes/api.php @@ -11,8 +11,10 @@ use Illuminate\Http\Request; | routes are loaded by the RouteServiceProvider within a group which | is assigned the "api" middleware group. Enjoy building your API! | -*/ + */ -Route::middleware('auth:api')->get('/user', function (Request $request) { - return $request->user(); +Route::middleware('auth:api', 'throttle:30')->group(function() { + Route::get('/user', function (Request $request) { + return $request->user(); + }); }); -- cgit v1.2.3