client = $client; $this->cache = $cache; $this->logger = $logger; } /** * Get the latest version number of Koel from GitHub. */ public function getLatestVersionNumber(): string { return $this->cache->remember(self::CACHE_KEY, 1 * 24 * 60, function (): string { try { return json_decode( $this->client->get('https://api.github.com/repos/phanan/koel/tags')->getBody() )[0]->name; } catch (Throwable $e) { $this->logger->error($e); return Application::KOEL_VERSION; } }); } }