Perbaiki logika looping dan penanganan data pada komponen memo
- Mengubah struktur pengaksesan array pada `$formFoto['rute_menuju_lokasi']` untuk memastikan data di-looping dengan benar. - Menambahkan pengecekan keberadaan key `path` sebelum menampilkan gambar untuk menghindari error.
This commit is contained in:
@@ -324,14 +324,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="">
|
<div class="">
|
||||||
@if (isset($formFoto) && isset($formFoto['rute_menuju_lokasi']) && is_array($formFoto['rute_menuju_lokasi']))
|
@if (isset($formFoto) && isset($formFoto['rute_menuju_lokasi']) && is_array($formFoto['rute_menuju_lokasi']))
|
||||||
@foreach ($formFoto['rute_menuju_lokasi'] as $item)
|
@foreach ($formFoto['rute_menuju_lokasi']['rute_menuju_lokasi'][0] as $item)
|
||||||
<div class="flex items-center justify-between mt-5">
|
<div class="flex items-center justify-between mt-5">
|
||||||
<div class="grid gap-5">
|
<div class="grid gap-5">
|
||||||
<h2 class="text-gray-600 font-semibold text-xl">
|
<h2 class="text-gray-600 font-semibold text-xl">
|
||||||
{{ ($item['name'] ?? "") . ' ' . $loop->index + 1 }}
|
{{ ($item['name'] ?? "") . ' ' . $loop->index + 1 }}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
|
@if(isset($item['path']))
|
||||||
<img src="{{ Storage::url($item['path']) }}" alt="">
|
<img src="{{ Storage::url($item['path']) }}" alt="">
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user