Read core module version from the AsgardCms class other modules keep same logic.

This allows to change the version at one place only for all core modules.
parent 00dc040b
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</td> </td>
<td> <td>
<a href="{{ route('admin.workshop.modules.show', [$module->getLowerName()]) }}"> <a href="{{ route('admin.workshop.modules.show', [$module->getLowerName()]) }}">
{{ str_replace('v', '', $module->version) }} {{ module_version($module) }}
</a> </a>
</td> </td>
<td> <td>
......
url: https://github.com/AsgardCms/Platform url: https://github.com/AsgardCms/Platform
versions: versions:
"2.x.x@unreleased":
changed:
- Read core module version from the AsgardCms class other modules keep same logic (<code>version</code> key in <code>module.json</code>)
"2.5.0": "2.5.0":
added: added:
- Module scaffold command now also generates form requests - Module scaffold command now also generates form requests
......
<?php
if (! function_exists('module_version')) {
function module_version($module)
{
if (is_core_module($module->name) === true) {
return \Modules\Core\AsgardCms::VERSION;
}
return $module->version;
}
}
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"Modules\\Workshop\\Providers\\WorkshopServiceProvider" "Modules\\Workshop\\Providers\\WorkshopServiceProvider"
], ],
"files": [ "files": [
"composers.php" "composers.php",
"helpers.php"
] ]
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment