awcodes/filament-versions

A mostly useless package to display framework versions at the bottom of the navigation panel.

Fund package maintenance!
awcodes

Installs: 28 303

Dependents: 4

Suggesters: 0

Security: 0

Stars: 41

Watchers: 2

Forks: 7

Open Issues: 0

Type:package

v2.0.1 2023-10-21 12:59 UTC

This package is auto-updated.

Last update: 2024-11-08 14:12:18 UTC


README

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.

versions-og

Installation

Install the package via composer

composer require awcodes/filament-versions

In an effort to align with Filament's theming methodology you will need to use a custom theme to use this plugin.

Note If you have not set up a custom theme and are using a Panel follow the instructions in the Filament Docs first.

Add the plugin's views to your tailwind.config.js file.

content: [
    '<path-to-vendor>/awcodes/filament-versions/resources/**/*.blade.php',
]

Usage

Register the plugin and/or Widget in your Panel provider:

use Awcodes\FilamentVersions\VersionsPlugin;
use Awcodes\FilamentVersions\VersionsWidget;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            VersionsPlugin::make(),
        ])
        ->widgets([
            VersionsWidget::class,
        ]);
}

Note If you are using the topNavigation option with your panel the sidebar widget will show up at the bottom of your pages content.

Disabling Navigation View

If you'd like to disable the navigation view and only use the dashboard widget you may do passing false or a Closure to the hasNavigationView method.

use Awcodes\FilamentVersions\VersionsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            VersionsPlugin::make()
                ->hasNavigationView(false),
        ]);
}

Custom Items

You can add custom items to the widgets by creating a new class that implements the VersionProvider interface.

use Awcodes\FilamentVersions\Providers\Contracts\VersionProvider;

class MyCustomVersionProvider implements VersionProvider
{
    public function getName(): string
    {
        return 'My Custom Version';
    }

    public function getVersion(): string
    {
        return '1.0.0';
    }
}

Then add the item to the plugin:

use Awcodes\FilamentVersions\VersionsPlugin;
use App\Filament\VersionProviders\MyCustomVersionProvider;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            VersionsPlugin::make()
                ->items([
                    new MyCustomVersionProvider(),
                ]),
        ]);
}

Disabling the default items

You can disable the default items by passing false or a Closure to the hasDefaultItems method.

use Awcodes\FilamentVersions\VersionsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            VersionsPlugin::make()
                ->hasDefaults(false)
        ]);
}

Widget options

You can change the column span and order of the widget by setting them on the plugin.

use Awcodes\FilamentVersions\VersionsPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            VersionsPlugin::make()
                ->widgetColumnSpan('full')
                ->widgetSort(2),
        ]);
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.