configureRateLimiting(); $this->routes(function () { Route::domain(config('endpoint.api.domain')) ->prefix(config('endpoint.api.path')) ->middleware('api') ->namespace($this->namespace) ->group(app_path('Endpoint/Api/routes.php')); Route::prefix('callback') ->namespace($this->namespace) ->group(app_path('Endpoint/Callback/routes.php')); Route::prefix('h5') ->namespace($this->namespace) ->group(app_path('Endpoint/Wap/routes.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(270)->by(optional($request->user())->id ?: $request->ip()); }); } }