I know that Laravel can do simple math and stuff... but I just confused if the data is from the same column... how to SUM that up?
The table:
sistem.blade.php
:
<table border='1'>
<th>Umur</th><th>Laki-laki</th><th>Perempuan</th><th>Jumlah</th>
@foreach($age as $a)
<tr>
<td>{{ $a->range }}</td><td>{{ $a->lk }}</td><td>{{ $a->pr }}</td><td>{{ $a->lk+$a->pr }}</td>
</tr>
@endforeach
<tr>
<td>Jumlah</td><td>sum lk</td><td>sum pr</td><td>sum lk+pr</td>
</tr>
</table>
I was wondering how am I supposed to code SUM lk, pr, and lk+pr, is it in controller or can it be done in resource/view blade file.