79725380

Date: 2025-08-04 20:58:42
Score: 2
Natty:
Report link

yes and its available here: https://laravel.com/docs/12.x/queries#additional-where-clauses

But for your case you can simply do

->when($filter, function ($query, $filter) {
    collect($filter)->each(function ($value) use ($query) {
        $query->whereIn('products.value', explode(',', $value));
    });
})

this is cleaner

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Olasunkanmi Emmanuel J.