F
Filamentβ€’11mo ago
Treebeard

Badge on content tabs

I have 3 content tabs on the top of my edit form, they are visible after adding hasCombinedRelationManagerTabsWithContent() to my EditUser class. My question is, can I add a badge to these tabs? I see that badges can be added to other types of tabs, but how would one go about adding a badge to content tabs? My use case is, I'd like to add the number of debts and number of payments as badges.
No description
Solution:
A relation manager can have badges too yes, even if combined ```php protected static ?string $badge = 'NEW'; ...
Jump to solution
2 Replies
Solution
dissto
disstoβ€’11mo ago
A relation manager can have badges too yes, even if combined
protected static ?string $badge = 'NEW';

//or

public static function getBadge(Model $ownerRecord, string $pageClass): ?string
{
return 100;
// return $ownerRecord->details->count();
// return $ownerRecord->debts->count();
}

// or whatever
protected static ?string $badge = 'NEW';

//or

public static function getBadge(Model $ownerRecord, string $pageClass): ?string
{
return 100;
// return $ownerRecord->details->count();
// return $ownerRecord->debts->count();
}

// or whatever
Treebeard
TreebeardOPβ€’11mo ago
Nice! That works. Thanks πŸ™‚
Want results from more Discord servers?
Add your server