最佳答案
$tests = Test::paginate();
$collect = $tests->sortBy(function($item){
return $item->num + 1;
});
$tests->setCollection($collect);
//这样就可以了
$tests = Test::paginate();
$collect = $tests->sortBy(function($item){
return $item->num + 1;
});
$tests->setCollection($collect);
//这样就可以了
推荐文章: