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\Services;
use Illuminate\Support\Facades\Cache;
@@ -30,6 +31,7 @@ final class SystemHealthService
{
try {
DB::connection()->getPdo();
return $this->result('Database', 'healthy', DB::connection()->getDriverName());
} catch (Throwable $e) {
return $this->result('Database', 'failed', $e->getMessage());
@@ -43,6 +45,7 @@ final class SystemHealthService
Cache::put($key, 'ok', 10);
$healthy = Cache::get($key) === 'ok';
Cache::forget($key);
return $this->result('Cache', $healthy ? 'healthy' : 'failed', config('cache.default'));
} catch (Throwable $e) {
return $this->result('Cache', 'failed', $e->getMessage());
@@ -56,6 +59,7 @@ final class SystemHealthService
Storage::disk('local')->delete('enterprise-health.txt');
$freeMb = (int) floor(disk_free_space(storage_path()) / 1024 / 1024);
$minimum = (int) config('enterprise.health.minimum_free_disk_mb', 512);
return $this->result('Storage', $freeMb < $minimum ? 'warning' : 'healthy', $freeMb.' MB free');
} catch (Throwable $e) {
return $this->result('Storage', 'failed', $e->getMessage());
@@ -66,14 +70,20 @@ final class SystemHealthService
{
$failed = Schema::hasTable('failed_jobs') ? DB::table('failed_jobs')->count() : 0;
$maximum = (int) config('enterprise.health.maximum_failed_jobs', 0);
return $this->result('Queue', $failed > $maximum ? 'warning' : 'healthy', $failed.' failed jobs');
}
private function environment(): array
{
$warnings = [];
if (app()->environment('production') && config('app.debug')) $warnings[] = 'APP_DEBUG is enabled';
if (! app()->environment('production')) $warnings[] = 'Not running in production';
if (app()->environment('production') && config('app.debug')) {
$warnings[] = 'APP_DEBUG is enabled';
}
if (! app()->environment('production')) {
$warnings[] = 'Not running in production';
}
return $this->result('Environment', $warnings ? 'warning' : 'healthy', $warnings ? implode('; ', $warnings) : app()->environment());
}