this is my code , this code get only color and size without subcategory_id $products=Product::whereIn('color',array($request['color1'],$request['color2'],$request['color3'],$request['color4'],$request['color5'],$request['color6'],$request['color7'],$request['color8'],$request['color9'],$request['color10'],$request['color11'],$request['color12'])) ->whereIn('size',array($request['size1'],$request['size2'],$request['size3'],$request['size4'],$request['size5'])) ->whereIn('subcategory_id',array($request['type1'],$request['type2'],$request['type3'],$request['type4'])) ->get();
via Ahmad Khamaysi