configureRateLimiting(); $this->routes(function () { Route::middleware('web') ->group(base_path('routes/web.php')); Route::middleware('api') ->prefix('api') ->group(base_path('routes/api.php')); }); Route::bind('media', function ($value) { return Media::whereUid($value)->firstOrFail(); }); Route::bind('basket_uuid', function ($value) { return Panier::where('uid', $value) ->with('owner')->firstOrFail(); }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); }); } }