Β© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filamentβ€’3y agoβ€’
3 replies
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'),
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 πŸ’•
image.png
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel β€’ Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

change color of a column value based on another column value
FilamentFFilament / β“β”Šhelp
3y ago
Hide table column based on value of another column
FilamentFFilament / β“β”Šhelp
11mo ago
Hide textColumn based of the value of another column
FilamentFFilament / β“β”Šhelp
3y ago
change background color for select column base on value
FilamentFFilament / β“β”Šhelp
3y ago