How can I set an Icon if file exists

How can I achieve if an image/file exists I can set an Icon in an table column and if the file/image not exist I would set an default icon. Cant seem to get the record in an IconColumn. Im usign spatie media library for filament file uploads
Solution
Tables\Columns\IconColumn::make('image_exists')
    ->boolean()
    ->state(fn(Model $record): bool => $record->hasMedia())

?
Was this page helpful?