How can you remove a single filter from a multiple select?

I'm using:
if ($data['zones'] ?? null) {
$zoneNames = Zone::whereIn('id', $data['zones'])->pluck('name', 'id')->toArray();
foreach ($zoneNames as $id => $name) {
$indicators[] = Indicator::make('Zona: ' . $name);
}
}
if ($data['zones'] ?? null) {
$zoneNames = Zone::whereIn('id', $data['zones'])->pluck('name', 'id')->toArray();
foreach ($zoneNames as $id => $name) {
$indicators[] = Indicator::make('Zona: ' . $name);
}
}
I have tried adding a removeField('"zone_{id}") but it doesn't work Query string is something like this: ?tableFilters[propertyFilters][zones][0]=1&tableFilters[propertyFilters][zones][1]=2
3 Replies
toeknee
toeknee4w ago
Sorry what do you mean remove a single filter from mutliple select? Do you mean remova an option from a multiple select? Can you provide the whole field code.
Daniel Reales
Daniel RealesOP4w ago
Yes, this is my filter:
Daniel Reales
Daniel RealesOP4w ago
I want to delete one zone from array when user click in active filters
No description

Did you find this page helpful?