new admin design with mnodules

This commit is contained in:
Mark Gregory
2026-07-24 09:35:18 +01:00
parent 5e9f95a5b4
commit c2a19a16e6
28 changed files with 205 additions and 42 deletions
@@ -0,0 +1,26 @@
<?php
namespace Modules\Administration\Http\Controllers;
use App\Http\Controllers\Controller;
final class ModuleController extends Controller
{
public function index()
{
$statuses = json_decode((string) file_get_contents(base_path('modules_statuses.json')), true) ?: [];
$modules = collect(glob(base_path('Modules/*/module.json')) ?: [])->map(function (string $manifest) use ($statuses): array {
$data = json_decode((string) file_get_contents($manifest), true) ?: [];
$name = $data['name'] ?? basename(dirname($manifest));
return [
'name' => $name,
'description' => $data['description'] ?? 'Laravel application module.',
'version' => $data['version'] ?? '1.0.0',
'enabled' => (bool) ($statuses[$name] ?? false),
'providers' => $data['providers'] ?? [],
];
})->sortBy('name', SORT_NATURAL | SORT_FLAG_CASE)->values();
return view('administration::modules.index', compact('modules'));
}
}