readComposerBuild(); if ($build === null) { $build = Setting::query()->where('key', 'build')->value('value'); } return response()->json([ 'connect' => 'ok', 'version_status' => [ 'build' => $build !== null ? (int) $build : null, ], 'notification_state' => false, ]); } private function readComposerBuild(): ?int { $path = base_path('composer.json'); if (!is_file($path) || !is_readable($path)) { return null; } $raw = file_get_contents($path); if ($raw === false) { return null; } $data = json_decode($raw, true); if (!is_array($data)) { return null; } $build = trim((string) ($data['build'] ?? '')); return ctype_digit($build) ? (int) $build : null; } }