Aggregation shouldn't mutate querybuilder
Aggregations (like $query->count() ) modifies the internal state of the queryBuilder object, therefore the $query looses eg. the projection. Eloquent solves this in the following way: https://github.com/laravel/framework/blob/5.3/src/Illuminate/Database/Query/Builder.php#L2036
Showing
Please
register
or
sign in
to comment