Hello,
Thank you for this package. I'm trying to dump the routes for modules in separate JSON files. How can I list routes for modules and dump them to JSON?
php artisan route:list | grep 'Modules\\Blog'
Thank you for your response.
How can same thing be achieved in application via browser?
function getModuleRoutes($moduleName, $baseModulesPath = 'Modules')
{
return collect(Route::getRoutes())->filter(function ($item) use ($baseModulesPath, $moduleName) {
return isset($item->action['namespace']) && starts_with($item->action['namespace'], "{$baseModulesPath}\\{$moduleName}");
})->values()->all();
}
Route::get('/test', function () {
return getModuleRoutes('Blog');
});
Great! Thank you that helped
Most helpful comment