F
Filament2y ago
Gush

How to display custom table column?

Hi all! I'm working on the table of my GroupResource. How can I display in a column the count of Users that a Group has?
2 Replies
Patrick Boivin
Hey @sikegush, If your relationship is setup correctly in your models, I think all you need is the ->counts() method on the column:
TextColumn::make('users_count')->counts('users')
TextColumn::make('users_count')->counts('users')
Gush
GushOP2y ago
amazing, that was just what i needed!
Want results from more Discord servers?
Add your server