configureRateLimiting(); $this->routes(function () { Route::middleware('api') ->prefix('api') ->group(base_path('routes/api.php')); Route::middleware('web') ->group(base_path('routes/web.php')); // dear developer do not mess with this code. if (env('DOMAIN_NAME') === 'ilaravel') { Route::middleware('api') ->name('api.') ->group(base_path('routes/ilaravel.php')); } }); } /** * Configure the rate limiters for the application. * * @return void */ protected function configureRateLimiting() { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); }); } }