mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
35 lines
855 B
PHP
35 lines
855 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Widgets;
|
|
|
|
use Filament\Widgets\Widget;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class ServerOverview extends Widget
|
|
{
|
|
protected static string $view = 'filament.widgets.server-overview';
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
protected function getViewData(): array
|
|
{
|
|
$currentVersion = Cache::get('latest_version', null);
|
|
|
|
$needsUpdate = false;
|
|
if ($currentVersion !== null && version_compare($currentVersion, config('app.version')) > 0) {
|
|
$needsUpdate = true;
|
|
}
|
|
|
|
return [
|
|
'version' => config('app.version'),
|
|
'build' => config('app.build'),
|
|
'environment' => config('app.env'),
|
|
'currentVersion' => $currentVersion,
|
|
'needsUpdate' => $needsUpdate,
|
|
];
|
|
}
|
|
}
|