I have a loop to display my data in table format.
<table>
<thead>
<th>name</th>
<th>qty</th>
</thead>
<tbody>
@foreach ($users as $user)
@foreach ($user->displayDetails($user->id) as $d)
<tr>
<td>{{$d->name}}</td>
<td>{{$d->ordered_qty}}</td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
The result output will be
name | qty
John 1
Lynn 1
Jack 2
What I am expecting is:
name | qty name | qty
John 1 Lynn 1
Jack 2
How can I make this?
You can use something like this: (It's much HTML splitting instead of Laravel)