Is it possible to build an eloquent query such that I get the parent, and then children as a sum aggregate.
so,
Order:
1
2
3
OrderLines:
type value
A 10
A 12
B 10
Result :
$order[0]->orderlines[0]->type would equate to A
$order[0]->orderlines[0]->value would equate to 22
$order[0]->orderlines[1]->type would equate to B
$order[0]->orderlines[1]->value would equate to 10
Anyway, there are many ways to achieve this; but first it depends on the nature of the relationship between Order and OrderLine models which is not clear above.