@foreach($order->products as $product)
<tr>
<td> {{ $product->id }}</td>
<td> {{ $product->name }}</td>
<td> {{ $product->getRelationValue('pivot')->qty }} </td>
<td> {{ $product->getRelationValue('pivot')->price }} </td>
<td> {{ $total = $product->getRelationValue('pivot')->price * $product->getRelationValue('pivot')->qty }} </td>
</tr>
@endforeach
Grand Total:{{$total}}
I would like to show the total value. Can someone help me out? And also the random access to $product->id in format 1,2,3....