so here s the query i want
$products = Product::whereHas('ProductFilter' , function($q) use ($filter_groups){
foreach($filter_groups as $k=>$v)
$q->where('f_id' , $k )->whereIn( 'value' ,$v );
})->get();
which will result in this query
select * from `products` where exists
(
select * from `product_filters` where
`product_filters`.`product_id` = `products`.`id` and
`f_id` = '4' and `value` in ('10', '11', '12', '13' ) and
`f_id` = '10' and `value` in ('34')
)
i want to group these line thoghether
`f_id` = '4' and `value` in ('10', '11', '12', '13' )
and
`f_id` = '10' and `value` in ('34')
like
( `f_id` = '4' and `value` in ('10', '11', '12', '13' ) )
and
( `f_id` = '10' and `value` in ('34') )