title: Multiple Foreach Loop - Laravel
body: <p>I am trying to merge 2 foreach loop results into 1 table. Attached image.
  <a href="https://i.stack.imgur.com/NOkV8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NOkV8.png" alt="enter image description here"></a></p>
  
  <p><strong>Column1 Products:</strong></p>
  
  <pre><code>$products=[{"product_name_id":"pro_des_5","quantity":180},{"product_name_id":"pro_des_6","quantity":240},{"product_name_id":"pro_des_7","quantity":156}];
  </code></pre>
  
  <p><strong>Rest data:</strong></p>
  
  <pre><code>$summary=[{"ptotal":1,"month":"March","product_id":"pro_des_7"},{"ptotal":3,"month":"April","product_id":"pro_des_5"},{"ptotal":2,"month":"April","product_id":"pro_des_6"},{"ptotal":12,"month":"April","product_id":"pro_des_7"}];
  </code></pre>
  
  <p>For each product there is per month consumption which I am trying to add under each month row getting data from $summary but unable to merge both foreach loop? Any advice.</p>
  
  <pre><code>&lt;tbody&gt;
  @foreach($products as $product)
  &lt;tr&gt;
  &lt;td&gt;{{$product-&gt;product_name_id}}&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;td&gt;0&lt;/td&gt;
  &lt;/tr&gt;
  @endforeach
  &lt;/tbody&gt;
  </code></pre>