I\'m making a products search by filters:
My code:
->where(function($query) use($filter)
{
if(!empty($filter)){
foreach ($filter as $key =&g
Yes, orWhereIn is a method that you can use.
I'm fairly sure it should give you the result you're looking for, however, if it doesn't you could simply use implode to create a string and then explode it (this is a guess at your array structure):
$values = implode(',', array_map(function($value)
{
return trim($value, ',');
}, $filters));
$query->whereIn('products.value', explode(',' $values));