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('basket_uuid', function ($value) { return Panier::where('uid', $value) ->with('owner')->firstOrFail(); }); // * API Route::bind('apiNoArticle', function ($value) { return Article::where('noArt', $value)->firstOrFail(); }); Route::bind('apiMedia', function ($value) { return Media::where(function ($q) use ($value) { $q->where('id', $value); })->whereIn('statut', [ MediaStatut::public, MediaStatut::public_etendu ])->firstOrFail(); }); Route::bind('apiMediaArcadiaId', function ($value) { return Media::where(function ($q) use ($value) { $q->where('arcadia_id', $value) ->whereNotNull('arcadia_id'); })->whereIn('statut', [ MediaStatut::public, MediaStatut::public_etendu ])->firstOrFail(); }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass RateLimiter::for('api', function (Request $request) { return Limit::perMinute(config('api.apiRequestRatePerMinute', 100)) ->by($request->user()?->id ?: app('clientIp')); }); } }