Laravel php combine two foreach
问题 In my blade.php file, I'm trying to merge two foreach loop to display data in the table. I had tried use something like nested loop but it doesn't work. @foreach($cat->products as $idx => $product) <tr ng-init="item.items[{{$cat->id}}][{{$idx}}] = {};"> @foreach ($queryInv as $querInvs) <td>{{$product->sku}}</td> <td>{{$product->name}}</td> <td class="text-right">{{{$querInvs->total or 0}}}</td> </tr> @endforeach @endforeach I just need to insert the total data into the table. Now the total