Closed chrisgrim closed 2 years ago
I figured out I had to create seperate queries
$prices = Query::range()->field('priceranges.price')->gte($request->price[0])->lte($request->price[1]);
and then load that into the when() builder
->when($request->price, function ($builder) use ($prices) { return $builder->must($prices); })
In a previous version, I could use the when statement for my compound queries like
however, with the new update, it seems the when() has been moved to the SearchParametersBuilder which just allows sorting etc.. Is there a way to do a when statement with a query?