This is what you get when you have a slow Saturday night and nobody around to annoy. You annoy the rest of the world.
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"
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());
}
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
.
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(),
]);
}
I didn't do any. Why should I make you?
Please see CHANGELOG for more information on what has changed recently, or to read something that is most likely horribly wrong.
Please see CONTRIBUTING for details. You know I never bothered to read the stub for this, right?
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.
The MIT License (MIT). Please see License File for more information. My God, you read this far.