I have the simplest of queries that I\'m trying to run
DB::table(\'user_visits\')->groupBy(\'user_id\')->count();
But it\'s returning the
You may try this because the group by statement is executed after the count(Bug #26209):
group by
count
DB::table('user_visits')->distinct('user_id')->count('user_id');
Another mySql answer here.