move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 14:50:13 +01:00
parent 5f0d2ceb72
commit 38b4a7406f
879 changed files with 24021 additions and 1 deletions
@@ -0,0 +1,27 @@
<?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'));
}
}