F
Filamentβ€’16mo ago
MRBUG

change color of money based on another column value

hello good morning i am sorry it is simple task but i am not able to do that so i have a column named type where i have enum "payout", "commission" and next i have a column amount where i want that if data type is payout then it will show in success color $3224 (example amount) and if f data type is commission then it will show in danger color -$3224 (example amount in minus ). here is my both code what can i do changes ??
Tables\Columns\TextColumn::make('type') ->badge() ->color(fn (string $state): string => match ($state) { 'payout' => 'info', 'commission' => 'success', }), Tables\Columns\TextColumn::make('amount') ->sortable()->searchable()->money('usd'),
here is sample image. thank you in advance. fi πŸ’•
No description
2 Replies
Tin
Tinβ€’16mo ago
Can you do something like this?
No description
MRBUG
MRBUGOPβ€’16mo ago
yeah thank you @tin777 its working.

Did you find this page helpful?