I have an array to be display in table format.
My table should display like this
Dept: Dept 1
No Name BankCode Amount
1. Name4 656789 119.20
Dept: Dept 2
No Name BankCode Amount
1. Name 1 DREW1CF 2775.24
2. Name 2 DREW1CF 907.28
3. Name 3 EWDR1CF 318.60
And this is my array
array:38 [▼
0 => {#389 ▼
+"FullName": "Name 1"
+"BankCode": "DREW1CF"
+"EntityName": "Dept 2"
+"amount": "2775.24"
}
1 => {#391 ▼
+"FullName": "Name 2"
+"BankCode": "DREW1CF"
+"EntityName": "Dept 2"
+"amount": "907.28"
}
2 => {#392 ▼
+"FullName": "Name 3"
+"BankCode": "EWDR1CF"
+"EntityName": "Dept 2"
+"amount": "318.60"
}
3 => {#393 ▼
+"FullName": "Name 4"
+"BankCode": "656789"
+"EntityName": "Dept 1"
+"amount": "119.20"
}
4 => {#394 ▶}
5 => {#395 ▶}
.....and so on
]
The code in Laravel framework.
Currently i am stuck with my foreach.
If i am doing like below, it will not display like i need.
How can i implement the foreach to be what i need?
I not very good in foreach especially with $key => $value.
@php
$i = 1;
@endphp
@foreach ($getClaim as $claims)
<tr>
<td>@php
echo $i++
@endphp</td>
<td>{{$claims->FullName}}</td>
<td>{{$claims->BankCode}}</td>
<td>{{number_format($claims->amount, 2, '.', ',')}}</td>
</tr>
@endforeach