This question already has an answer here:
Laravel split collection method
(1个答案)
去年关门了。
控制器
$collections = $questions->split(5);
$collections->toArray();
dd($collections);

尽职调查
Collection {#455 ▼
#items: array:5 [▼
0 => Collection {#394 ▶}
1 => Collection {#619 ▶}
2 => Collection {#407 ▶}
3 => Collection {#398 ▶}
4 => Collection {#275 ▶}
]
}

看法
我在divView中打印收藏。然后如何按集合打印它们。
问题是如何:按collectioncollection打印

最佳答案

使用索引获取特定集合

@foreach($collections[0] as $collection)

关于php - laravel拆分数据5.6 ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49772076/

10-16 09:45