我想在循环中获取所有数据。由于我是Laravel的新手,我不知道该怎么做。提前谢谢。
My Array看起来像这样:
array:2 [
0 => Collection {
#items: array:1 [
0 => {
"id": 3
"gallery_id": 1
"is_thumb_image": 1
"thumbnail": "public\album/kRzunwjAEIXciv1nN2RdsUFB4Ptpu4TjAUSECZCE.jpeg"
}
]
}
1 => Collection {
#items: array:1 [
0 => {
"id": 6
"gallery_id": 2
"is_thumb_image": 1
"thumbnail": "public\album/BKYp72YUZNiZdljDyOjny9HgikR0whlyp0dkLVzV.jpeg"
}
]}]
答案 0 :(得分:1)
你应该试试这个: 如果您在刀片文件中使用,那么下面的答案对您有帮助
@foreach($collections as $collection)
@foreach($colection as $item)
{{ $item->id; }}
{{ $item->is_thumb_image; }}
@endforeach
@endforeach
答案 1 :(得分:0)
使用foreach循环显示数据 例如:
@foreach($collections as $collection)
@foreach($colection as $item)
{{ $item->id; }}
{{ $item->is_thumb_image; }}
@endforeach
@endforeach