I have a eloquent request with GroupBy and SelectRaw with joins table ... I would like to count the rows but when i do that i got the 'count' column in each row with the number of joined table rows ...
I think that i need to remove the 'selectRaw' and 'GroupBy' options from the query builder, but i would like to use the same query instance for the two requests.
I would like to do this but actualy it is not working :
$count = $query->count('settlements.id'); $data = $query->paginate($per_page, ['*'], 'page', $page);
Thanks for help