$app['config']['env'], 'database_configured' => $app['database']->isConfigured(), 'installed' => is_file(dirname(__DIR__) . '/storage/installed.lock'), ]; try { if ($status['database_configured']) { $count = $app['database']->pdo()->query('SELECT COUNT(*) FROM tenants')->fetchColumn(); $status['database_reachable'] = true; $status['tenant_count'] = (int) $count; } else { $status['database_reachable'] = false; } } catch (\Throwable $throwable) { $status['database_reachable'] = false; $status['error'] = $throwable->getMessage(); } header('Content-Type: application/json'); echo json_encode($status, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;