So I\'m trying to get the number of distinct pids on a query, but the returned value is wrong.
This is what I try to do:
$ad->getcodes()->group
A more generic answer that would have saved me time, and hopefully others:
Does not work (returns count of all rows):
DB::table('users') ->select('first_name') ->distinct() ->count();
The fix:
DB::table('users') ->distinct() ->count('first_name');