configureRateLimiting(); $this->registerGlobalRouteParamConstraints(); $this->routes(function () { Route::middleware($_ENV['APP_API_PREFIX'] ?? 'api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { RateLimiter::for($_ENV['APP_API_PREFIX'] ?? 'api', function (Request $request) { return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); }); } protected function registerGlobalRouteParamConstraints() { Route::pattern('workspaceId', '[0-9]+'); } }