Need eloquent/fluent query to get sum with groupBy function.
So far I have tried:
$this->data['no_of_pages'] = Document::sum('no_of_pages')
->groupBy('users_editor_id');
Which ofcourse gives me call to member function groupBy() on non-object
because of the fact that sum() will already execute the query and have result ready by the time grouBy() is applied. So can anyone guide me?