public function isNewVersionAvailable($currentVersion = '') : bool
    {
        $version = $currentVersion ?: $this->getVersionInstalled();

        if (! $version) {
            throw new \InvalidArgumentException('No currently installed version specified.');
        }

        // Remove the version file to forcefully update current version
        $this->deleteVersionFile();

        if (version_compare($version, $this->getVersionAvailable(), '<')) {
            if (! $this->versionFileExists()) {
                $this->setVersionFile($this->getVersionAvailable());
                event(new UpdateAvailable($this->getVersionAvailable()));
            }

            return true;
        }

        return false;
    }
public function isNewVersionAvailable($currentVersion = '') : bool
    {
        $version = $currentVersion ?: $this->getVersionInstalled();

        if (! $version) {
            throw new \InvalidArgumentException('No currently installed version specified.');
        }

        // Remove the version file to forcefully update current version
        $this->deleteVersionFile();

        if (version_compare($version, $this->getVersionAvailable(), '<')) {
            if (! $this->versionFileExists()) {
                $this->setVersionFile($this->getVersionAvailable());
                event(new UpdateAvailable($this->getVersionAvailable()));
            }

            return true;
        }

        return false;
    }
public function isNewVersionAvailable ( $ currentVersion = '' ) : bool { $ version = $ currentVersion ? : $ this -> getVersionInstalled ( ) ; if ( ! $ version ) { throw new \ InvalidArgumentException ( 'No currently installed version specified.' ) ; } // Remove the version file to forcefully update current version $ this -> deleteVersionFile ( ) ; if ( version_compare ( $ version , $ this -> getVersionAvailable ( ) , '<' ) ) { if ( ! $ this -> versionFileExists ( ) ) { $ this -> setVersionFile ( $ this -> getVersionAvailable ( ) ) ; event ( new UpdateAvailable ( $ this -> getVersionAvailable ( ) ) ) ; } return true ; } return false ; }
Check repository if a newer version than the installed one is available.

@param string $currentVersion

@throws \InvalidArgumentException
@throws \Exception

@return bool
Check repository if a newer version than the installed one is available .