title: Laravel, sum in foreach
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>foreach($group as $key=&gt;$value)
  {
      echo $key. " = " .$value. "&lt;br&gt;";
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>for example</p>
  
  <pre><code>For example:
  
  doc1 = 8
  
  doc2 = 7
  
  doc3 = 1
  
  doc4 = 5
  </code></pre>
  
  <p>i want to show and sum doc1 + doc2 as TOTAL1, </p>
  
  <p>then sum TOTAL1  + doc3 as TOTAL2,</p>
  
  <p>then sum TOTAL2 + doc4 as TOTAL3</p>
  
  <p>how to show it in blade? thank u for help me</p>