Badge on sub-navigation

Is it possible to create a badge with a relation count of the ownerRecord() on the new sub navigation menu?
Solution:
```php public static function getNavigationBadge(): ?string { return Number::format( number: Livewire::current()->getRecord()->subscribers()->count(),...
Jump to solution
2 Replies
BlackShadow
BlackShadowOP11mo ago
public static function getNavigationBadge(): ?string
{
return "Count here"; // static won't work here or Using $this when not in object context
}
public static function getNavigationBadge(): ?string
{
return "Count here"; // static won't work here or Using $this when not in object context
}
Solution
BlackShadow
BlackShadow11mo ago
public static function getNavigationBadge(): ?string
{
return Number::format(
number: Livewire::current()->getRecord()->subscribers()->count(),
);
}
public static function getNavigationBadge(): ?string
{
return Number::format(
number: Livewire::current()->getRecord()->subscribers()->count(),
);
}
Want results from more Discord servers?
Add your server