@tykus thanks for the answer but I'm afraid it's not working
It seems when there are multiple filters your code is doing an OR search between them.
Given the array I posted before it should do:
WHERE brand = 'scania' OR brand = 'volvo' OR brand = 'man' AND color = 'red' OR color = 'blue'''
Oh nvm, I think I just need to replace orWhereIn for whereIn.
@EB942 ok, so we have a filter operation already - this removes from $active_filters any key/value pairs where the value is falsey (i.e. empty array). So the next operation is to filter/reject the specified keys - if the current key is in the array of excluded keys, we reject that key/value pair