【发布时间】:2019-11-15 10:53:17
【问题描述】:
对于 DB 中的每个表,我有四个带 CRUD 的刀片。
在 homeblade 中,我需要一个表格,我可以从每个表格中放置一列,并将其填充到列中,而不是连续填充。
这是我在刀片中的代码:
<div class="container">
<table>
<tr>
<th>Companies</th>
<th>Devices</th>
<th>Vehicles</th>
<th>Drivers</th>
</tr>
@foreach($companies as $company)
<tr>
<td>{{$company->name}}</td>
@endforeach
@foreach($devices as $device)
<td>{{$device->type}}</td>
@endforeach
@foreach($vehicles as $vehicle)
<td>{{$vehicle->license_plate}}</td>
@endforeach
@foreach($drivers as $driver)
<td>{{$driver->name}}</td>
@endforeach
</tr>
</table>
</div>
我需要桌子这样看 Picture of table that I need
我为 foreach 循环和表尝试了几种不同的变体,但我没有更多的想法。
【问题讨论】: