badge color is not reactive on table

TextInputColumn::make('test_2'), TextColumn::make('total') ->badge() ->color(fn (string $state): string => $state <= $failedGrade ? 'danger' : '') I have a testinput like this that update the total column. Total column get updated but badge color does not get updated until page reload. Any way to make badge color also reactive on table?
5 Replies
Mikail
Mikail4w ago
hi
Lara Zeus
Lara Zeus4w ago
seams working:
Tables\Columns\TextInputColumn::make('name'),
TextColumn::make('id')
->badge()
->color(fn(Package $record)=>$record->name === 'Thunder' ? 'danger' : 'info')
Tables\Columns\TextInputColumn::make('name'),
TextColumn::make('id')
->badge()
->color(fn(Package $record)=>$record->name === 'Thunder' ? 'danger' : 'info')
Mikail
Mikail4w ago
Indeed. But I can't figure out why mine is not. I have latest Filament version. TextInputColumn::make('discipline'), TextColumn::make('id') ->badge() ->color(fn ($record): string => $record->discipline === 'art' ? 'danger' : ''),
toeknee
toeknee4w ago
have you overridden the colors in the panel provider?
Mikail
Mikail4w ago
nope. color won't update until page reload it did work correctly when i set the default value to a neutral color like 'gray' rather than empty ''. Thanks
Want results from more Discord servers?
Add your server