change the color of the tabs
Excuse me, can I change the color of the tabs and make them look like a badge for filtering by color
public function getTabs(): array
{
$colors = Patient::distinct('file_colors')->pluck('file_colors');
$tabs = [
'all' => Tab::make('الكل')
->icon('heroicon-o-list-bullet'),
];
foreach ($colors as $color) {
$label = $this->getColorLabel($color);
$badgeColor = $this->getBadgeColor($color);
$hex = $this->getHexColor($color);
$tabs[$color] = Tab::make($label)
->modifyQueryUsing(fn(Builder $query) => $query->where('file_colors', $color))
->badge(Patient::where('file_colors', $color)->count())
->badgeColor($badgeColor)
->extraAttributes([
'style' => "background-color: $hex; color: #000 !important;",
'class' => 'patient-filter-tab',
]);
}
return $tabs;
}

1 Reply
You can customize it with a custom css theme
checkout this docs
https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme