Help with displaying json casted as a collection in a table column
I am sure I am missing it, but I cannot find any examples or good documentation on displaying a collection in a column. I see the
listWithLineBreaks
& the bulleted
for related properties, but I have a JSON property that is being cast to a collection & I cannot figure out how to display it on the table. I have also tried formatStateUsing(fn (Collection $p): string => $p->implode(','))
, but I get an error on that too.1 Reply
I think you have to cast it as an Array and then you can just display it like this:
TextColumn::make('authors.name')
->listWithLineBreaks()
->bulleted()
more info:
https://filamentphp.com/docs/3.x/tables/columns/text#listing-multiple-values