1Document::groupBy('users_editor_id')
2 ->selectRaw('sum(no_of_pages) as sum, users_editor_id')
3 ->pluck('sum','users_editor_id');
4
5 // originally lists(), which was deprecated in favour of pluck in 5.2
6 // and dropped completely in 5.3
7 // ->lists('sum','users_editor_id');
8
9
10// returns array like this:
11array(
12 users_editor_id => sum,
13 ...
14)