$system_health, 'extensions' => self::extensions(), 'php_version' => phpversion(), 'min_php_version' => self::$php_version, 'dbs' => self::dbCheck(), ]; } private static function extensions() :array { $loaded_extensions = []; foreach(self::$extensions as $extension) { $loaded_extensions[] = [$extension => extension_loaded($extension)]; } return $loaded_extensions; } private static function dbCheck() :array { $result = []; if (! config('ninja.db.multi_db_enabled')) { $pdo = DB::connection()->getPdo(); if($pdo) $result[] = [ DB::connection()->getDatabaseName() => TRUE ]; else $result[] = [ config('database.connections.' . config('database.default') . '.database') => FALSE ]; } else { foreach (MultiDB::$dbs as $db) { MultiDB::setDB($db); $pdo = DB::connection()->getPdo(); if($pdo) $result[] = [ DB::connection()->getDatabaseName() => TRUE ]; else $result[] = [ config('database.connections.' . config('database.default') . '.database') => FALSE ]; } return $result; } } }