3 years ago

intersect sub query

Posted 3 years ago by mohammad6006

I want to filter my products page there is a filter table and filter_product table with many to many relation with product table

my filters table is like this:


//filters with same parent_id shoud be OR in filtering and the result of that shoud be AND with different parent id filtering



for example I want to filter product by color and size

color: -red -green

size: -large -xlarge

(red OR green ) AND (large OR xlarg) how can do that?

its the code that I write And I want to know how can i get intersect result of two sub query

->whereHas('filters' , function ($query){


Please sign in or create an account to participate in this conversation.