lasthourcloud/app/Http/Livewire/CheckUpdate.php
Andras Bacsai 6e7ee0ca48 a ton 👷‍♂️
2023-05-24 14:26:50 +02:00

25 lines
685 B
PHP

<?php
namespace App\Http\Livewire;
use Livewire\Component;
class CheckUpdate extends Component
{
public $updateAvailable = false;
public $latestVersion = 'latest';
protected $currentVersion;
protected $image = 'ghcr.io/coollabsio/coolify';
public function checkUpdate()
{
$this->latestVersion = get_latest_version_of_coolify();
$this->currentVersion = config('version');
if ($this->latestVersion === 'latest') {
$this->updateAvailable = true;
return;
}
version_compare($this->currentVersion, $this->latestVersion, '<') ? $this->updateAvailable = true : $this->updateAvailable = false;
}
}