Skip to content

Commit

Permalink
feat: include logo + version on dashboard widget
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHetem committed Jan 21, 2025
1 parent bc1e58a commit 92adf7c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
29 changes: 29 additions & 0 deletions app/Filament/Widgets/DashboardWidget.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace App\Filament\Widgets;

use Filament\Widgets\Widget;
use App\Services\VersionService;

class DashboardWidget extends Widget
{
protected static string $view = 'filament.widgets.dashboard-widget';
protected int | string | array $columnSpan = 'full';
protected string $version;
protected string $version_full;

public function mount(
VersionService $versionSvc
) {
$this->version = $versionSvc->getCurrentVersion(false);
$this->version_full = $versionSvc->getCurrentVersion(true);
}

protected function getViewData(): array
{
return [
'version' => $this->version,
'version_full' => $this->version_full,
];
}
}
10 changes: 10 additions & 0 deletions resources/views/filament/widgets/dashboard-widget.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<x-filament-widgets::widget>
<x-filament::section>
<div class="flex justify-between items-center">
<img src="{{ public_asset('/assets/img/logo_blue_bg.svg') }}" width="135px" alt="phpvms Logo" />
<div class="flex items-center">
<h1 title="{{ $version_full }}">{{ $version }}</h1>
</div>
</div>
</x-filament::section>
</x-filament-widgets::widget>

0 comments on commit 92adf7c

Please sign in to comment.