forked from phpvms/phpvms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: include logo + version on dashboard widget
- Loading branch information
1 parent
bc1e58a
commit 92adf7c
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
10
resources/views/filament/widgets/dashboard-widget.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |