fix(surveyor/penilai):perbaikkan pengambilan key luas unit dan handle foto di informasi
This commit is contained in:
@@ -67,19 +67,21 @@
|
||||
}
|
||||
// Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
|
||||
$validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
|
||||
return isset($forminspeksi[$type]) && file_exists(storage_path('app/public/' . $forminspeksi[$type]));
|
||||
return isset($forminspeksi[$type]) && !empty($forminspeksi[$type]) && is_string($forminspeksi[$type]);
|
||||
});
|
||||
@endphp
|
||||
@foreach ($validPhotoTypes as $type)
|
||||
@php
|
||||
$imagePath = $forminspeksi[$type] ?? null;
|
||||
$imageUrl = is_string($imagePath) ? asset('storage/' . $imagePath) : null;
|
||||
|
||||
@endphp
|
||||
@if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
|
||||
<tr>
|
||||
<td style="20%"> {{ $customLabels[$type] ?? '' }}</td>
|
||||
<td width="1%" style="vertical-align: top;"></td>
|
||||
<td style="width: 79%">
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imagePath }}"
|
||||
<img src="{{ storage_path('app/public/' . $imagePath) }}" alt="{{ $imageUrl }}"
|
||||
style="max-height: 400px; height: auto; max-width: 100%;">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user