Filter Indicator : Color
Hi I wanna know if there's any way to change the color of the FilterIndicator that I'm creatins with ->indicateUsing().
Filter::make('etiqueta')
->form([
Select::make('etiqueta')
->options(Etiqueta::all()->pluck('titulo', 'id')->toArray())
->native(false),
])
->query(function (Builder $query, array $data): Builder {
if (!empty($data['etiqueta'])) {
$etiquetaId = $data['etiqueta'];
return $query->whereHas('etiquetas', function (Builder $query) use ($etiquetaId) {
$query->where('id', $etiquetaId);
});
}
return $query;
})
->indicateUsing(function(array $data): ?string{
if(! $data['etiqueta']){
return null;
}
return 'fas-tag'.$data['etiqueta'];
}),
Solution:Jump to solution
in the IndicateUsing you could return a Tables\Filters\Indicator or an array of indicators in which you can set the color
see: https://filamentphp.com/docs/3.x/tables/filters/custom#multiple-active-indicators for an example...
3 Replies
Solution
in the IndicateUsing you could return a Tables\Filters\Indicator or an array of indicators in which you can set the color
see: https://filamentphp.com/docs/3.x/tables/filters/custom#multiple-active-indicators for an example
Perfect Thanks a lot π