A mostly useless package to display framework versions at the bottom of the Filament Admin navigation panel and an optional widget to do the same in the dashboard or custom pages.
Install the package via composer
composer require awcodes/filament-versions
The navigation panel is loaded automatically.
To use the widget, just include it either in your filament.php
config file under the 'widgets' section:
'widgets' => [
'namespace' => 'App\\Filament\\Widgets',
'path' => app_path('Filament/Widgets'),
'register' => [
...
\FilamentVersions\FilamentVersionsWidget::class
],
],
Or
The widget can also be included as a normal Livewire component on any custom pages, etc:
<filament-versions-widget />
If you'd like to disable the navigation view and only use the dashboard
widget you may do so by using the registerNavigationView
method on
the FilamentVersions
facade in a service provider's register
handler.
use FilamentVersions\Facades\FilamentVersions;
public function register()
{
FilamentVersions::registerNavigationView(false);
}
You can also add your own versions by simply including the
FilamentVersions
facade and adding items inside the boot
method of a
service provider in your app.
use FilamentVersions\Facades\FilamentVersions;
use Composer\InstalledVersions;
public function boot()
{
FilamentVersions::addItem('App', 'v12.1.82');
FilamentVersions::addItem('Tinker', fn() => InstalledVersions::getPrettyVersion('laravel/tinker'));
}
The second parameter of addItem() can also except a Closure, but it must return a string.