How can I return Sum and count with other data in laravel 5.4 query builder? Suppose I have orders, orderDetails and Customers table. I want to return orderDetails list related to order and count of the row in oderDetails table.
id----customer-------totalorder-----totalAmount
2-----John--------------5------------2500
totalorder is the orderDetails table row count related to order id 2 and totalAmount is the sum of those 5 orders.
For the above output how can I make laravel query builder.