F
Filamentβ€’6mo ago
Barbaracrlp

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:
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...
Jump to solution
3 Replies
Solution
Tally
Tallyβ€’6mo ago
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
Tally
Tallyβ€’6mo ago
->indicateUsing(function(array $data) {
return Tables\Filters\Indicator::make('something')
->label('The Nice Name')
->color(Color::Lime);
}),
->indicateUsing(function(array $data) {
return Tables\Filters\Indicator::make('something')
->label('The Nice Name')
->color(Color::Lime);
}),
Barbaracrlp
BarbaracrlpOPβ€’6mo ago
Perfect Thanks a lot πŸ™‚
Want results from more Discord servers?
Add your server