configureRateLimiting(); $this->routes(function () { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); }); //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed Route::bind('gammeSlug', function ($value, $route) { $gamme = Gamme::where('slug', 'LIKE', '%:"' . $value . '"%')->firstOrFail(); return $gamme; }); Route::bind('productSlug', function ($value, $route) { $gamme = $route->parameter('gammeSlug'); $product = Product::where('slug', 'LIKE', '%:"' . $value . '"%') ->where('gamme_id', $gamme->id) ->firstOrFail(); return $product; }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); }); } }