0
我想將來自新帖子的饋送排序到舊帖子。
此代碼發佈在上面舊飼料而新進的底部如何使用foreach在PHP上降序排序?
@if(count($feeds) > 0)
@foreach($feeds->all() as $feed)
<div class="col-lg-12">
<blockquote>
<p>{{ $feed->feed }}</p>
</blockquote>
</div>
@endforeach
@endif
這是controller
調用飼料
public function home() {
$feeds = Feed::all();
return view('home', ['feeds' => $feeds]);
}