change row background color

i found some things which change color for row like striped() but i want to if status == 1 this row background color should be red. just how i can give red background color for row?
14 Replies
gigiloouu
gigiloouuOP10mo ago
i found it too but its not works.. i try to change default to see result but its not works..
->recordClasses(fn (Model $record) => $record->status == 1 ? 'bg-red-500' : 'bg-red-500')
->recordClasses(fn (Model $record) => $record->status == 1 ? 'bg-red-500' : 'bg-red-500')
im using this but not works
Thijmen
Thijmen10mo ago
Do you have a custom theme?
gigiloouu
gigiloouuOP10mo ago
no
Thijmen
Thijmen10mo ago
If you just want bg-red-500 you can remove the shorthand function And you need a custom theme
gigiloouu
gigiloouuOP10mo ago
i just have table which have status value and if this status value == 1 i want to be red background color of this column its needed any theme?
Thijmen
Thijmen10mo ago
Yes it needs a theme And with your code it always is red. Whether it == 1 or not
gigiloouu
gigiloouuOP10mo ago
yes now i know becouse i was testing if works any way u know can u send me a theme link? i try to search it in plugins but there was not
gigiloouu
gigiloouuOP10mo ago
just install it and next use this recordClasse right?
Thijmen
Thijmen10mo ago
Yes if you create the theme correctly it will become red
gigiloouu
gigiloouuOP10mo ago
okay thanks i will try php artisan make:filament-theme i install like that and use this again intable but its not works is there any thing i should add?
Thijmen
Thijmen10mo ago
Follow the whole documentation Also you need to run npm run build or dev
gigiloouu
gigiloouuOP10mo ago
thanks its works now ❤️
Want results from more Discord servers?
Add your server