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