If you just want an array of counts, union won't work for you. Select count(*) from multiple tables
$counts = [
'city' => City::count(),
'category' => Category::count(),
'client' => Client::count(),
'property' => Property::count(),
];
There's no need to keep it in one query.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…