FilamentF
Filament•2y ago
Zoltar

custom background columns in table grid

Hello,
Another day another request 🤓

I'm trying to recreate a grid like the attached image
the background color of columns depend by a value stored in $record

my code is below
Immagine_WhatsApp_2024-07-17_ore_17.23.23_9ac82d01.jpg
Solution
->recordClasses(fn (Model $record) => match ($record->id) {
                21 => 'custom-bg-color-black',
                22 => 'custom-bg-color-red',
                23 => 'custom-bg-color-yellow',
                default => null,
            })
Was this page helpful?