我有一个集合,我使用雄辩的 findMany 方法从数据库中提取了这些集合。当我添加收藏时,它看起来像附加的图像。然后我尝试(在我的刀片中)遍历数组中的每个项目,以便我能够打印实际记录中的每个值。
$question = Question::whereIn('id', [23,25])->get();
然后在我的刀片中我正在尝试做:
@foreach ($question as $row => $innerArray)
@foreach ($innerArray as $innerRow => $value)
{{$value->question}} //I was expecting "What is your favourite food" here
@foreach ($value->option as $choice)
<li>{{$choice}}</li> //I was expecting the list of the options here
@endforeach
@endforeach
@endforeach
我究竟做错了什么?
天涯尽头无女友
慕尼黑的夜晚无繁华