version = config('unit3d.version'); } /** * Check the latest release of UNIT3D and compare them to the local version. * * @return string */ public function checkVersion() { $client = new Client(); $response = json_decode($client->get('//api.github.com/repos/HDInnovations/UNIT3D/releases')->getBody()); $lastestVersion = $response[0]->tag_name; return response([ 'updated' => version_compare($this->version, $lastestVersion, '<') ? false : true, 'latestversion' => $lastestVersion ]); } }