configureRateLimiting(); $this->routes(function () { Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.php')); Route::prefix('admin') ->middleware('web') ->namespace($this->namespace) ->group(base_path('routes/admin.php')); Route::prefix('restaurant-panel') ->middleware('web') ->namespace($this->namespace) ->group(base_path('routes/vendor.php')); Route::prefix('api/v1') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api/v1/api.php')); Route::prefix('api/v2') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api/v2/api.php')); }); } /** * 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()); }); } }