Skip to content

A FilamentPHP version of the worlds most awesome but useless VSCode Extension

License

Notifications You must be signed in to change notification settings

sonja-turo/duckmode-filament

Repository files navigation

Duck Mode for Filament

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is what you get when you have a slow Saturday night and nobody around to annoy. You annoy the rest of the world.

Installation

Firstly, pour yourself a large draw of your favourite drink. Don't mind me, I'll wait.

...

Ok, done? Now, install the package via composer:

composer require sonja-turo/duckmode-filament

Next, because Duck Mode without Quacking is just a silly package instead of the life changing experience it was designed to be, install the assets:

php artisan vendor:publish --tag="duckmode-filament-assets"

Usage

Adding Duck Mode to your admin panel

Firstly, register the plugin with your panel. It's easy, don't be shy, just open the relevant FilamenttPHP Panel Provider, and add the plugin file.

use Sonjaturo\DuckmodeFilament\DuckmodeFilamentPlugin;
...
public function panel(Panel $panel): Panel
{
    return $panel
        ...
        ->plugin(DuckmodeFilamentPlugin::make());
}

Feeder Widget

Add the Feeder Widget to anywhere in your FilamentPHP dashboard by appending it to the widgets array in your panel's configuration. Starvation and murders are tracked over time.

use Sonjaturo\DuckmodeFilament\Bread;
use Sonjaturo\DuckmodeFilament\BreadType;
use Sonjaturo\DuckmodeFilament\FeederWidget;
...
public function panel(Panel $panel): Panel
{
    return $panel
        ...
        ->widgets([
            Widgets\AccountWidget::class,
            Widgets\FilamentInfoWidget::class,
            FeederWidget::make([
                'starvationRate' => 1000,
                'bread' => new Bread(BreadType::White)
            ]),
        ]);
}

Set the starvationRate to the number of milliseconds for each tick that your's health deteriorates.

The optional bread parameter can be one of the known bread types: White, Brown, Multigrain, GlutenFree, Pita, Turkish, Raisin, Dwarf or None. The default is White.

Table Quactions

To add quacking to any of your Filament table definitions, just add a Quaction to your table actions.

use Sonjaturo\DuckmodeFilament\Tables\Quaction;
...
public function table(Table $table): Table
{
    return $table
        ...
        ->actions([
            Quaction::make(),
        ]);
}

Testing

I didn't do any. Why should I make you?

Changelog

Please see CHANGELOG for more information on what has changed recently, or to read something that is most likely horribly wrong.

Contributing

Please see CONTRIBUTING for details. You know I never bothered to read the stub for this, right?

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities. Nope, didn't read this either. But you're installing this anyway, and even I'm telling you not to. Says more about you than it does me.

Credits

License

The MIT License (MIT). Please see License File for more information. My God, you read this far.

About

A FilamentPHP version of the worlds most awesome but useless VSCode Extension

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published