configureRateLimiting(); $this->routes(function () { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); Route::prefix('auth') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/auth.php')); Route::prefix('admin') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/admin.php')); Route::prefix('customer') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/customer.php')); if (app(ConfigService::class)->isStore()) { Route::prefix('pargar') ->middleware('LogRequests') ->namespace($this->namespace) ->group(base_path('routes/pargar.php')); } Route::middleware('web') ->namespace($this->namespace) ->group(base_path('routes/web.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()); }); } }