F
Filamentβ€’15mo 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β€’15mo ago
Can you do something like this?
No description
MRBUG
MRBUGOPβ€’15mo ago
yeah thank you @tin777 its working.
Want results from more Discord servers?
Add your server