sonja-turo / duckmode-filament
Duck Mode plugin for FilamentPHP
Fund package maintenance!
sonja-turo
Requires
- php: ^8.1
- andreiio/blade-iconoir: ^3.3
- filament/filament: ^3.0
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.15.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-03-08 08:11:10 UTC
README
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.