$query = User::leftJoin('data1', 'data1.user_id', '=', 'users.id')
->leftJoin('data2', 'data2.user_id', '=', 'users.id')
->select('data1.text as value', 'data2.name as value', DB::raw('count(*) as users_count'))
->groupBy('value')
->orderByDesc('users_count');