1$p1 = DB::table('properties')
2 ->where('address', 'test')
3 ->select('name', 'address');
4
5$p2 = DB::table('properties_x')
6 ->where('address', 'test')
7 ->select('name', 'address');
8
9$p = $p1->unionAll($p2);
10
11DB::table(DB::raw("({$p->toSql()}) AS p"))
12->mergeBindings($p)
13->select('name', 'address')
14->paginate(10);
15