【发布时间】:2018-01-06 10:45:03
【问题描述】:
我正在使用 Laravel 5.4
所以我想知道是否能够在不实际使用查询的情况下对表中的内容进行排序。
这是我的表结构:
<table class="table table-hover">
<tr>
<th>ID</th>
<th>Item</th>
<th>Total Earnings</th>
<th>Quantity Sold</th>
<th>Date</th>
</tr>
<thead>
</thead>
<tbody>
@forelse($solditems as $solditem)
<tr>
<td>{{$solditem->item_id}}</td>
<td>{{$solditem->item}}</td>
<td>{{$solditem->subtotal}}</td>
<td>{{$solditem->qty}}</td>
<td>{{\Carbon\Carbon::parse($solditem->created_at)->format('j F Y h:i A')}}</td>
</tr>
@empty
@endforelse
</tbody>
</table>
【问题讨论】:
标签: php laravel html-table