laravel拆分数据5.6

时间:2018-04-11 09:59:17

标签: php mysql laravel eloquent

控制器

$collections = $questions->split(5);
$collections->toArray();
dd($collections);

DD

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

查看

我在div View打印馆藏。然后如何通过集合收集打印它们。

问题是如何:collectioncollection

打印

1 个答案:

答案 0 :(得分:1)

使用索引获取特定集合

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