Multicolor TextColumn Badge

Can I implement the colors in a TextColumn like this? - If so, how do I do that? - I have an array with the Spatie-Roles.
No description
2 Replies
Dhru
Dhru3w ago
you need to add TextColumn::make('status') ->badge() ->color(fn (string $state): string => match ($state) { 'draft' => 'gray', 'reviewing' => 'warning', 'published' => 'success', 'rejected' => 'danger', }) to that text column

Did you find this page helpful?