From 08de0eeb00410a0930beceb2118da0b1d8ba7433 Mon Sep 17 00:00:00 2001 From: majid Date: Tue, 31 Dec 2024 17:10:13 +0700 Subject: [PATCH] perbaikan name objek null --- .../penilai/components/foto-jaminan.blade.php | 51 +++++++++++-------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/resources/views/penilai/components/foto-jaminan.blade.php b/resources/views/penilai/components/foto-jaminan.blade.php index 8c895e2..bb53d1f 100644 --- a/resources/views/penilai/components/foto-jaminan.blade.php +++ b/resources/views/penilai/components/foto-jaminan.blade.php @@ -7,7 +7,7 @@ @php - $imagePath = storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $item['path']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) @@ -25,7 +25,7 @@ @php - $imagePath = storage_path('app/public/' . $item['foto_rute_lainnya']); + $imagePath = storage_path('app/public/' . $item['foto_rute_lainnya']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['foto_rute_lainnya']))) @@ -36,26 +36,37 @@ @endif - @if (isset($formFoto['object_jaminan'])) + @if (!empty($formFoto['object_jaminan'])) @foreach ($formFoto['object_jaminan'] as $item) -
-

- {{ $item['name_objek'] }} -

+ @php + $nameObjek = trim($item['name_objek'] ?? ''); + $fotoObjek = trim($item['foto_objek'] ?? ''); + $imagePath = storage_path('app/public/' . $fotoObjek); + @endphp - @php - $imagePath = storage_path('app/public/' . $item['foto_objek']); - @endphp + @if (!empty($nameObjek) || !empty($fotoObjek)) +
+ @if (!empty($nameObjek)) +

+ {{ $nameObjek }} +

+ @endif - @if ($statusLpj || file_exists(storage_path('app/public/' . $item['foto_objek']))) - {{ $item['foto_objek'] }} - @endif -
+ @if ($statusLpj || (!empty($fotoObjek) && file_exists($imagePath))) + {{ $nameObjek ?: 'Objek Foto' }} + @else +

Foto tidak tersedia

+ @endif +
+ @endif @endforeach + @else +

Tidak ada objek jaminan yang ditemukan

@endif - @if (isset($formFoto['foto_lantai_unit'] )) + + @if (isset($formFoto['foto_lantai_unit'])) @foreach ($formFoto['foto_lantai_unit'] as $index => $floorPhotos) @foreach ($floorPhotos as $index => $item)
@@ -64,7 +75,7 @@ @php - $imagePath = storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $item['path']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) @@ -83,7 +94,7 @@ @php - $imagePath = storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $item['path']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) @@ -100,7 +111,7 @@ @php - $imagePath = storage_path('app/public/' . $formFoto['foto_basement']); + $imagePath = storage_path('app/public/' . $formFoto['foto_basement']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_basement']))) @@ -116,7 +127,7 @@ @php - $imagePath = storage_path('app/public/' . $formFoto['foto_gerbang']); + $imagePath = storage_path('app/public/' . $formFoto['foto_gerbang']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_gerbang']))) @@ -132,7 +143,7 @@ @php - $imagePath = storage_path('app/public/' . $formFoto['pendamping']); + $imagePath = storage_path('app/public/' . $formFoto['pendamping']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['pendamping'])))