将集合转换为刀片中的列表

问题描述

任何人都知道我如何将其转换为刀片中的列表

[{“ 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>

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...