$builder->from('table')->whereSubquery(function ($query) {
$query->where('a', '=', 1)->orWhere('b', '=', 2);
})->whereSubquery(function ($query) {
$query->where('a', '=', 1)->orWhere('b', '=', 2);
});
// SELECT * FROM table WHERE (a = 1 OR b = 2) AND (a = 2 OR b = 2)