configureRateLimiting(); $this->routes(function () { Route::domain(config('endpoint.api.domain')) ->group(function () { Route::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::fallback(function () { return response()->json([ 'errcode' => 404, 'message' => 'Not Found', ], 404); }); }); }); } /** * 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()); }); } }