I would like to format a textColumn of type badge many to many.

Tables\Columns\TextColumn::make('contacts.forename')
->label('Parent')
** ----> for each contact badge i want forename and surname**
->badge()
->color('warning')
->searchable(),
Tables\Columns\TextColumn::make('contacts.forename')
->label('Parent')
** ----> for each contact badge i want forename and surname**
->badge()
->color('warning')
->searchable(),
2 Replies
karim charfaoui
karim charfaouiOP5d ago
some can help me please ??
Dennis Koch
Dennis Koch5d ago
Can you access single values through ->formatStateUsing(fn ($record) => $record->forename . ' ' . $record->surname)? Otherwise you could use a virtual column in your database. That would also support searching

Did you find this page helpful?