答案 0 :(得分:0)
在您的控制器中:
$ transaction = DB :: table(' transaction') - > get();
在你的刀锋中:
<?php $tbalance=0; ?>
@foreach($transaction as $trans)
<tr>
<td>{{$invaccstatements->ref_no}} </td>
<td>{{number_format($invaccstatements->credit, 2)}}</td>
<td>{{number_format($invaccstatements->debit, 2)}}</td>
<td align="right"><?php $chkbala = $invaccstatements->credit - $invaccstatements->debit; echo $tbalance += $chkbala; ?></td>
</tr>
@endforeach