title('BIIProject System Health Check'); $rows = []; // 1. Database try { DB::connection()->getPdo(); $rows[] = ['Database', 'PostgreSQL', 'CONNECTED']; } catch (\Exception $e) { $rows[] = ['Database', 'PostgreSQL', 'FAILED']; } // 2. Redis try { Redis::ping(); $rows[] = ['Cache', 'Redis', 'CONNECTED']; } catch (\Exception $e) { $rows[] = ['Cache', 'Redis', 'FAILED']; } // 3. Storage $storageOk = true; try { Storage::disk('local')->put('health-check.txt', 'ok'); Storage::disk('local')->delete('health-check.txt'); } catch (\Exception $e) { $storageOk = false; } $rows[] = ['Storage', 'Local Writable', $storageOk ? 'OK' : 'FAILED']; // 4. AI $aiEnabled = get_setting('ai_enabled', false); $aiProvider = get_setting('ai_provider', 'N/A'); $rows[] = ['Intelligence', 'AI Service', $aiEnabled ? "ENABLED ({$aiProvider})" : 'DISABLED']; // 5. Broadcast $rows[] = ['Real-time', 'Reverb', config('reverb') ? 'CONFIGURED' : 'NOT CONFIGURED']; $this->table(['Component', 'Service', 'Status'], $rows); $this->newLine(); $this->info('System check completed at '.now()->toDateTimeString()); return 0; } protected function title($text) { $this->newLine(); $this->line(' '.strtoupper($text).' '); $this->newLine(); } }