tag_name); $installedVersion = Helpers::cleanVersionNumber(config('2fauth.version')); if ($githubVersion && $installedVersion) { if (version_compare($githubVersion, $installedVersion) > 0 && $latestReleaseData->prerelease == false && $latestReleaseData->draft == false) { Settings::set('latestRelease', $latestReleaseData->tag_name); Log::info(sprintf('New release found: %s', var_export($latestReleaseData->tag_name, true))); return $latestReleaseData->tag_name; } else { Settings::delete('latestRelease'); } } } return $latestRelease ? false : null; } /** * Fetch releases on Github */ protected static function getLatestReleaseData() : string|null { $url = config('2fauth.latestReleaseUrl'); try { $response = Http::withOptions([ 'proxy' => config('2fauth.config.outgoingProxy'), ])->retry(3, 100)->get($url); if ($response->successful()) { Settings::set('lastRadarScan', time()); return $response->body(); } } catch (\Exception $exception) { Log::error(sprintf('cannot reach %s endpoint', var_export($url, true))); } return null; } }