我有如下JSON数据,然后我想用laravel在我的表中显示originalName,怎么做


{
"s": true,
"d": [
{
"detailItemImage": []
},
{
"detailItemImage": []
},
{
"detailItemImage": [
{
"originalName": "puma_one.jpg",
"itemId": 101,
"path": null,
"rotate": 0,
"fileName": "/accurate/files/data_456811/item-image/item_101/item-image_9d07992d-663a-40d8-ba69-76e3aea874b2.jpg",
"extension": ".jpg",
"optLock": 0,
"thumbnailPath": "/accurate/files/data_456811/item-image/item_101/item-image-thumb_9d07992d-663a-40d8-ba69-76e3aea874b2.jpg",
"name": "img0",
"id": 50,
"seq": 0
}
]
},
{
"detailItemImage": []
}
],
"sp": {
"page": 1,
"sort": null,
"pageSize": 20,
"pageCount": 1,
"rowCount": 4,
"start": 0,
"limit": null
}
}

我有这样的代码,错误在哪里?

<tbody>
@php
$i = 1;
@endphp
@foreach ($data['d'] as $key => $item)
<tr class="odd">
<td>{{ $i++ }}</td>
@foreach ($data['d'['detailItemImage']] as $items)
<td>{{ $items['originalName']}}</td>
<td>
<div class="btn-group">
<a href="{{ url('detail-produk/'.$key)}}"
class="btn btn-success btn-sm">Detail</a>
<a href="" {{--"{{ url('edit-kat/'.$key)}}" --}}
class="btn btn-warning btn-sm">Edit</a>
<a href="" {{--"{{ url('edit-kat/'.$key)}}" --}}
class="btn btn-danger btn-sm">Hapus</a>
</div>
</td>
@endforeach
</tr>
@endforeach
</tbody>

相关内容

  • 没有找到相关文章

最新更新