json(['error' => 'Build info unavailable'], 404) ->header('Cache-Control', 'no-store, max-age=0'); } $decoded = json_decode((string) file_get_contents($path), true); if (! is_array($decoded)) { return response()->json(['error' => 'Build info unavailable'], 404) ->header('Cache-Control', 'no-store, max-age=0'); } $commit = trim((string) ($decoded['git_sha'] ?? '')); $release = trim((string) ($decoded['release_id'] ?? '')); $builtAt = trim((string) ($decoded['deployed_at_utc'] ?? '')); if ($commit === '' || $release === '' || $builtAt === '') { return response()->json(['error' => 'Build info unavailable'], 404) ->header('Cache-Control', 'no-store, max-age=0'); } return response()->json([ 'environment' => app()->environment(), 'commit' => $commit, 'built_at' => $builtAt, 'release' => $release, ])->header('Cache-Control', 'no-store, max-age=0'); } }