问题描述
任何人都知道我如何将其转换为刀片中的列表
[{“ 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>