configureRateLimiting(); $this->routes(function () { Route::prefix('api') ->middleware('api') ->namespace($this->namespace) ->group(base_path('routes/api.php')); Route::middleware('web') ->namespace($this->namespace) ->group(function () { require base_path('routes/web.php'); require base_path('routes/fortify.php'); // <-- Fortify routes, with some routes disabled as they are customized and therefore in web.php require base_path('routes/test.php'); }); }); // Route parameter constraints: Route::pattern('id', '[0-9]+'); Broadcast::routes([ 'middleware' => ['auth.any:admin,bank,organization,web'], ]); } /** * 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()); }); } }