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 Sese2y ago
->color(fn (Model $record): string => $record->briefcase_count === 1 ? 'success' : 'danger')
Pablo Torres
Pablo TorresOP2y ago
Thank you, works nicely...
Want results from more Discord servers?
Add your server