cache = $cache; $this->token = $token; } /** * Returns the latest GitHub release. * * @return string */ public function latest() { $release = $this->cache->remember('version', 720, function () { $headers = ['Accept' => 'application/vnd.github.v3+json']; // We can re-use the Emoji token here, if we have it. if ($this->token) { $headers['OAUTH-TOKEN'] = $this->token; } return json_decode((new Client())->get('https://api.github.com/repos/cachethq/cachet/releases/latest', [ 'headers' => $headers, ])->getBody(), true); }); return $release['tag_name']; } }