Table IconColumn different colors.

Hi, I want to have different colors for my icons. The code below tells me that 'danger' is applied by default as my 'x-circle' icon is, how do I apply a different color like 'success' to the records that actually like in this case have one 'briefcase' ? Thanks.
Tables\Columns\IconColumn::make('briefcase')
->options([
'heroicon-o-x-circle',
'heroicon-o-check-circle' => fn ($state, $record): int => $record->briefcase_count === 1,
])
->colors([
'danger',
'success' => 'published',
])
->sortable()
->toggleable(),
Tables\Columns\IconColumn::make('briefcase')
->options([
'heroicon-o-x-circle',
'heroicon-o-check-circle' => fn ($state, $record): int => $record->briefcase_count === 1,
])
->colors([
'danger',
'success' => 'published',
])
->sortable()
->toggleable(),
2 Replies
Kenneth Sese
Kenneth Sese13mo ago
->color(fn (Model $record): string => $record->briefcase_count === 1 ? 'success' : 'danger')
Pablo Torres
Pablo Torres13mo ago
Thank you, works nicely...