Use same icon for different state in BadgeColumn

I need to use same icon class for different value, how to make it possible?
BadgeColumn::make('status')
->icons([
'heroicon-o-clock' => 'Pending',
'heroicon-o-clock' => 'Awaiting Confirmation',
])
BadgeColumn::make('status')
->icons([
'heroicon-o-clock' => 'Pending',
'heroicon-o-clock' => 'Awaiting Confirmation',
])
The structure above however looks impossible (and didn't work) as those values share the same key. I tried something like this but still didn't work.
BadgeColumn::make('status')
->icons([
'heroicon-s-clock' => ['Pending','Awaiting Confirmation'],
])
BadgeColumn::make('status')
->icons([
'heroicon-s-clock' => ['Pending','Awaiting Confirmation'],
])
Any way to achieve that?
2 Replies
Dan Harrin
Dan Harrin2y ago
'heroicon-s-clock' => fn ($state) => in_array($state, ['Pending','Awaiting Confirmation']),
IndomieRendang
IndomieRendangOP2y ago
Great... thanks!
Want results from more Discord servers?
Add your server