3 回答
TA贡献1836条经验 获得超13个赞
您不需要对单个记录应用循环,因为您可以看到它是单个记录。
<div class="card" >
<div class="card-body ">
<div class="shipment-number">
<span class="title" style="display: block; font-size: 25px!important;">{{$shipment->tracking_code }}</span>
</div><!-- Track_Num -->
</div>
<br><br>
<div id="shipper-info" class="row" >
<div class="col-md-6 detail-section">
<p class="shipper details"><strong>Shipper's Information</strong></p>
<div class="shipper details">
<p><span class="label">Shipper Name : </span>{{$shipment->sender_name }}</p>
<p><span class="label">Phone Number : </span>{{$shipment->telephone }}</p>
<p><span class="label">Email : </span>{{$shipment->sender_email }}</p>
<p><span class="label">Address : </span>{{$shipment->sender_address }}</p>
</div>
</div>
<div class="col-md-6 detail-section">
<p class="shipper details"><strong>Receiver's Information</strong></p>
<div class="receiver details">
<p><span class="label">Receiver Name : </span>{{$shipment->receiver_name }}</p>
<p><span class="label">Phone Number : </span>{{$shipment->receiver_telephone }}</p>
<p><span class="label">Address : </span>{{$shipment->receiver_address }}</p>
<p><span class="label">Email : </span>{{$shipment->receiver_email }}</p>
</div>
</div>
<div class="clear-line"></div>
</div>
TA贡献1806条经验 获得超5个赞
获取数据时删除->first()
,->get() or ->paginate(x)
改为使用,这样您就可以获得集合。
在刀片文件中,foreach循环使用相同的变量作为集合和单个数据
@foreach($shipment as $shipment)
我建议您使用$shipments
集合作为变量,并使用 $shipment 作为实例。
x 只是一个数字
- 3 回答
- 0 关注
- 122 浏览
添加回答
举报