callVikonApiTask->getWithToken( 'pull_updates/getLatestVersion', $accessToken ); $body = $response->json(); $latestVersion = $body['version'] ?? null; $hasUpdate = $latestVersion && version_compare($latestVersion, $this->currentVersion, '>'); return [ 'current_version' => $this->currentVersion, 'has_update' => $hasUpdate, 'latest_version' => $latestVersion, ]; } catch (\Throwable $e) { \Illuminate\Support\Facades\Log::warning('Vikon version check failed', [ 'error' => $e->getMessage(), ]); return [ 'current_version' => $this->currentVersion, 'has_update' => false, 'latest_version' => null, 'error' => 'Не удалось проверить наличие обновлений', ]; } } /** * Get current version without checking for updates */ public function getCurrentVersion(): string { return $this->currentVersion; } }