Counting relations in infolist

I'm trying to show the nr. of relationships (rows) from a one-to-many relationship on a infolist.
Tried a lot, nothing worked. I think it may can be done with a placeholder? How exactly?
Solution
TextEntry::make('total')
    ->getStateUsing(fn ($record) => $record->xxx->count())

?
Was this page helpful?