Added script as the 4th parameter to the 'sum' function. Now, it is possible to perform more complexed operations on the sum function. For example, we can do the following:
Item::es()->aggregate('Value', function($q) {
$q->sum('', null, null, ['source' => 'doc.price.value * doc.quantity.value'])->groupBy('status');
})->get()->aggregations();