One think that you can do in web.php file is this
foreach(File::allFiles(__DIR__.'/web') as $file) {
require $file->getPathname();
}
where in web folder you have multiple files of routes
A second option is to add some code in RouteServiceProvider
as an example
protected function mapModuleRoutes()
{
foreach ($this->modules as $module) {
if (file_exists(app_path('Modules/' . $module .'/routes.php'))) {
Route::middleware('web')
->namespace($this->namespace)
->group(app_path('Modules/'. $module . '/routes.php'));
}
}
}
Here I have modular structure and each module has its routes.php file