Skip to content

Commit

Permalink
Update install method
Browse files Browse the repository at this point in the history
  • Loading branch information
SonjaTuro committed Mar 3, 2024
1 parent a9580fe commit 62c3302
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,39 @@ php artisan vendor:publish --tag="duckmode-filament-assets"

## Usage

Um, I think it auto-adds itself to the default Filament Admin Panel dashboard.
### 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.

```php
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.

```php
use Sonjaturo\DuckmodeFilament\FeederWidget;
...
public function panel(Panel $panel): Panel
{
return $panel
...
->widgets([
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
FeederWidget::class,
]);
}
```

## Testing

Expand Down
1 change: 0 additions & 1 deletion src/DuckmodeFilamentPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function register(Panel $panel): void
$panel
->widgets([
...$panel->getWidgets(),
FeederWidget::class,
]);
}

Expand Down

0 comments on commit 62c3302

Please sign in to comment.