storage . DIRECTORY_SEPARATOR . 'VERSION'; $gitHead = implode(DIRECTORY_SEPARATOR, [$this->gitRoot, 'logs', 'HEAD']); $version = 'n/a'; if (file_exists($file)) { $version = trim(file_get_contents($file)); } elseif (file_exists($gitHead)) { $lines = file($gitHead) ?: []; $lastLine = array_pop($lines) ?: ''; $words = explode(' ', $lastLine); $version = Str::substr($words[1] ?? '', 0, 7); } return $this->config->get('version', $version); } }