<?php
 namespace ModStart\App\Web; use Illuminate\Support\Facades\Route; use ModStart\Module\ModuleManager; class ModStartWeb { public static function registerModuleRoutes() { $modules = ModuleManager::listAllInstalledModules(); foreach ($modules as $module => $_) { if (file_exists($file = ModuleManager::path($module, 'Web/routes.php'))) { Route::group([ 'prefix' => config('modstart.web.prefix'), 'middleware' => ['web.bootstrap'], 'namespace' => "\\Module\\$module\\Web\\Controller", ], function ($router) use ($file) { require $file; }); } } if (file_exists($routes = modstart_web_path('routes.php'))) { require $routes; } } }