При запросе моделей атрибуты будут засчитаны только по первой модели .(ларавел 5.8)
https://stackoverflow.com/questions/59802387/laravel-union-query-using-eloquent
#in your case, you don't need to use subtable, just use union without subtable:
$a = Customers::select('name', DB::raw("'Customer' AS `type`"));
$b = Suppliers::select('name', DB::raw("'Supplier' AS `type`"));
$a->union($b)->orderBy('type')->limit(20);
#And if you want to use with subtable, you can do it like this:
$a = Customers::select('name', DB::raw("'Customer' AS `type`"));
$b = Suppliers::select('name', DB::raw("'Supplier' AS `type`"));
$c = $a->union($b);
Customers::selectRaw('a.name, a.type')
->from(DB::raw("(".$c->toSql().") AS a"))
->mergeBindings($c->getQuery()) // if you have parameters
->orderBy('type')
->limit(20);
# For query builder you can do it like this:
$a = Customers::select('name', DB::raw("'Customer' AS `type`"));
$b = Suppliers::select('name', DB::raw("'Supplier' AS `type`"));
$c = $a->union($b);
DB::table(DB::raw("({$c->toSql()}) AS a"))
->mergeBindings($c->getQuery())
->orderBy('a.type')
->select('a.name', 'a.type')
->limit(20);