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
dissto13mo 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
TreebeardOP13mo ago
Nice! That works. Thanks 🙂

Did you find this page helpful?