如何解决将集合转换为刀片中的列表
任何人都知道我如何将其转换为刀片中的列表
[{“ applicant”:“ Juan”},{“ applicant”:“ Pedro”}]
类似:
-胡安
-佩德罗
当前,该集合是数组的一项 {{$申请人[$ i]}}包含[{“ applicant”:“ Juan”},{“ applicant”:“ Pedro”}]
刀片文件
<td>
{{$applicant[$i]}}
</td>
控制器
for ($i=0; $i <= 59; $i++) {
$materias[$i]->name;
$applicant[$i] = DB::table('projections')
->where('s1',$materias[$i]->name)
->orWhere('s2',$materias[$i]->name)
->orWhere('s3',$materias[$i]->name)
->orWhere('s4',$materias[$i]->name)
->orWhere('s5',$materias[$i]->name)
->orWhere('s6',$materias[$i]->name)
->orWhere('s7',$materias[$i]->name)
->orWhere('s8',$materias[$i]->name)
->select('applicant')->get();
}
结果 image whit the result of the view
解决方法
在Blade中,您需要做类似的事情:
Check this documentation about loop in blade
<td>
<ul>
@foreach($applicant[$i] as $appli)
<li> {{ $appli }} </li>
@endforeach
</ul>
</td>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。