How do I show no icon when column's state is false?

Instead of the default red cross icon I just want the column to be blank.
class Note extends Model
{
protected $casts = [
'is_important' => 'boolean',
];
}
class Note extends Model
{
protected $casts = [
'is_important' => 'boolean',
];
}
Tables\Columns\IconColumn::make('is_important')
->icon(fn (string $state): string => match ($state) {
'1' => 'heroicon-o-exclamation-circle',
'' => '',
})
Tables\Columns\IconColumn::make('is_important')
->icon(fn (string $state): string => match ($state) {
'1' => 'heroicon-o-exclamation-circle',
'' => '',
})
No description
1 Reply
Vp
Vp12mo ago
'0' => '',

Did you find this page helpful?