coolify/app/Http/Livewire/CheckUpdate.php

25 lines
685 B
PHP
Raw Normal View History

2023-04-14 10:00:42 +02:00
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class CheckUpdate extends Component
{
public $updateAvailable = false;
2023-04-27 13:02:24 +02:00
public $latestVersion = 'latest';
2023-04-14 10:00:42 +02:00
protected $currentVersion;
protected $image = 'ghcr.io/coollabsio/coolify';
public function checkUpdate()
{
2023-05-24 14:26:50 +02:00
$this->latestVersion = get_latest_version_of_coolify();
2023-05-09 14:46:22 +02:00
$this->currentVersion = config('version');
2023-04-27 13:02:24 +02:00
if ($this->latestVersion === 'latest') {
$this->updateAvailable = true;
return;
}
2023-04-14 10:00:42 +02:00
version_compare($this->currentVersion, $this->latestVersion, '<') ? $this->updateAvailable = true : $this->updateAvailable = false;
}
}