style updates

This commit is contained in:
Mark Gregory
2026-07-24 14:59:44 +01:00
parent 24ab771cd3
commit dd23205d0b
482 changed files with 7173 additions and 1435 deletions
@@ -1,4 +1,5 @@
<?php
namespace Modules\Enterprise\Console;
use Illuminate\Console\Command;
@@ -8,17 +9,20 @@ use Modules\Enterprise\Services\SystemHealthService;
final class HealthCheckCommand extends Command
{
protected $signature = 'enterprise:health {--json}';
protected $description = 'Run enterprise platform health checks.';
public function handle(SystemHealthService $service): int
{
$result = $service->run();
HealthRun::create(['status' => $result['status'], 'results' => $result, 'ran_at' => now()]);
if ($this->option('json')) $this->line(json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
else {
if ($this->option('json')) {
$this->line(json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
} else {
$this->table(['Check', 'Status', 'Message'], collect($result['checks'])->map(fn (array $check) => [$check['name'], $check['status'], $check['message']])->all());
$this->line('Overall: '.$result['status']);
}
return $result['status'] === 'failed' ? self::FAILURE : self::SUCCESS;
}
}