FilamentF
Filament2y ago
Dima

How to show only a single icon or boolean on an array column in table view

A record may have multiple files uploaded that are stored in DB column attachments as an array. In the table list I want to show a single icon if the record has any attachments at all. However, the code below shows a list of icons for each of the item of the array in the attachments column.

Tables\Columns\IconColumn::make('attachments')->icon('heroicon-o-photo'),

// The same is with boolean, please see the attached screenshot
Tables\Columns\IconColumn::make('attachments')->boolean(),
image.png
image.png
Was this page helpful?