The count() function is a replacement for the laravel one which doesn't work when you are using a group by