您的subject
属性的内容是一个JSON字符串。这意味着您必须json_decode()
先将其解码为数组/对象,然后才能对其进行迭代。
<table>
<thead>
<tr>
<th>right</th>
<th>left</th>
</tr>
</thead>
<tbody>
@foreach(json_decode($about->subject) as $subject)
<tr>
<td>{{ $subject->name1 }}</td>
<td>{{ $subject->name2 }}</td>
</tr>
@endforeach
</tbody>
</table>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句