Change badge color on NavigationItem in AdminPanelProdiver

Hi! I added a few direct links to my tabs in the navigation items by using the navigationItems function inside the provider Here is my current code : NavigationItem::make('document') ->group('Suivi des événements') ->icon('heroicon-o-document') ->sort(21) ->badge(function (): ?int { $count = EventResource::getEloquentQuery()->where('type', 'document')->where('is_new', true)->count(); return $count > 0 ? $count : null; }) ->label(fn(): string => __('Documents')) ->url(fn(): string => EventResource::getUrl() . '?activeTab=document') ->isActiveWhen(fn() => request()->routeIs('filament.admin.resources.events.*') && request()->input('activeTab') === 'document'), I don't find out to change the badge color. There is a badge function and a badgeTooltip function but I can't find a badgeColor. Is that possible to specity from here? Thx
Solution:
OR this ->badge('2', color: 'gray')
Jump to solution
3 Replies
Solution
Vp
Vp2mo ago
OR this ->badge('2', color: 'gray')
Jérôme
Jérôme2mo ago
ah yes it works at at the param of badge... thx @Vp 🙂