有些人可以告诉我如何在Laravel 5的视图中显示这个数组的结果吗?
RowCollection {#464 ▼
#title: "Worksheet"
#items: array:3 [▼
0 => CellCollection {#472 ▼
#title: null
#items: array:2 [▼
"name" => "Owen Kelley"
"age" => 29.0
]
}
1 => CellCollection {#473 ▼
#title: null
#items: array:2 [▼
"name" => "Jim Jackson"
"age" => 50.0
]
}
2 => CellCollection {#474 ▼
#title: null
#items: array:2 [▼
"name" => "Sally Anne"
"age" => 35.0
]
}
]
}
我多年来一直在努力奋斗!
非常感谢。
答案 0 :(得分:2)
你应该使用foreach,例如:
在controller / routes.php中:
return view('yourviewname')->with('elephants', 'elephants')
在刀片视图中
@foreach($elephants as $elephant)
{{ $elephant->name }}
@endforeach