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