you are reading the documentation for version
v1
our latest version is
v2
make sure to select the correct version.
to check your version use:
to check your version use:
composer show lara-zeus/filament-plugin-tools
On this page
Disable Badges
Disable Badges
This allow your users to customize the badges of the resource first add the trait to your plugin:
1class MyAwesomePlugin extends FilamentPluginTools implements Plugin2{3 use CanDisableBadges;4}
and in your resource:
1public static function getNavigationBadge(): ?string2{3 if(MyAwesomePlugin::get()->getNavigationBadgesVisibility(static::class)){4 return '10 new items';5 }6}
Now, if your users want to disable the badge:
1public function panel(Panel $panel): Panel2{3 return $panel4 // ...5 ->plugins([6 MyAwesomePlugin::make()7 ->hideNavigationBadges(MyResource::class),8 ]);9}