*/ protected function getViewData(): array { /** @var string|null $currentVersion */ $currentVersion = config('app.version'); /** @var string|null $build */ $build = config('app.build'); $latestVersion = Cache::get('latest_version', null); $needsUpdate = false; if ($latestVersion !== null && $currentVersion !== null && version_compare($latestVersion, $currentVersion) > 0) { $needsUpdate = true; } return [ 'version' => $currentVersion, 'build' => $build, 'environment' => config('app.env'), 'currentVersion' => $latestVersion, 'needsUpdate' => $needsUpdate, ]; } }