diff --git a/resources/views/pdf/final_log_page_1.blade.php b/resources/views/pdf/final_log_page_1.blade.php index 486b4e2e..f0b51f8b 100644 --- a/resources/views/pdf/final_log_page_1.blade.php +++ b/resources/views/pdf/final_log_page_1.blade.php @@ -216,8 +216,9 @@
@php - if(!empty($logoPerusahaan->path)) { - $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path))); + $logoPath = !empty($logoPerusahaan->path) ? storage_path('app/public/' . $logoPerusahaan->path) : null; + if (!empty($logoPath) && is_file($logoPath)) { + $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); echo ''; } @endphp diff --git a/resources/views/pdf/final_log_page_1_primayan.blade.php b/resources/views/pdf/final_log_page_1_primayan.blade.php index f5a98f47..1d46220d 100644 --- a/resources/views/pdf/final_log_page_1_primayan.blade.php +++ b/resources/views/pdf/final_log_page_1_primayan.blade.php @@ -216,8 +216,9 @@
@php - if(!empty($logoPerusahaan->path)) { - $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path))); + $logoPath = !empty($logoPerusahaan->path) ? storage_path('app/public/' . $logoPerusahaan->path) : null; + if (!empty($logoPath) && is_file($logoPath)) { + $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); echo ''; } @endphp diff --git a/resources/views/pdf/final_log_page_2.blade.php b/resources/views/pdf/final_log_page_2.blade.php index fc847e9d..64151938 100644 --- a/resources/views/pdf/final_log_page_2.blade.php +++ b/resources/views/pdf/final_log_page_2.blade.php @@ -210,8 +210,9 @@
@php - if(!empty($logoPerusahaan->path)) { - $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path))); + $logoPath = !empty($logoPerusahaan->path) ? storage_path('app/public/' . $logoPerusahaan->path) : null; + if (!empty($logoPath) && is_file($logoPath)) { + $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); echo ''; } @endphp diff --git a/resources/views/pdf/final_log_page_2_primayan.blade.php b/resources/views/pdf/final_log_page_2_primayan.blade.php index d1eae975..279ff93c 100644 --- a/resources/views/pdf/final_log_page_2_primayan.blade.php +++ b/resources/views/pdf/final_log_page_2_primayan.blade.php @@ -210,8 +210,9 @@
@php - if(!empty($logoPerusahaan->path)) { - $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path))); + $logoPath = !empty($logoPerusahaan->path) ? storage_path('app/public/' . $logoPerusahaan->path) : null; + if (!empty($logoPath) && is_file($logoPath)) { + $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); echo ''; } @endphp diff --git a/resources/views/pdf/req_log_page_1.blade.php b/resources/views/pdf/req_log_page_1.blade.php index 3442824b..7b749c20 100644 --- a/resources/views/pdf/req_log_page_1.blade.php +++ b/resources/views/pdf/req_log_page_1.blade.php @@ -224,8 +224,9 @@
@php - if(!empty($logoPerusahaan->path)) { - $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path))); + $logoPath = !empty($logoPerusahaan->path) ? storage_path('app/public/' . $logoPerusahaan->path) : null; + if (!empty($logoPath) && is_file($logoPath)) { + $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); echo ''; } @endphp diff --git a/resources/views/pdf/req_log_page_1_primayan.blade.php b/resources/views/pdf/req_log_page_1_primayan.blade.php index c1a157a9..47896c40 100644 --- a/resources/views/pdf/req_log_page_1_primayan.blade.php +++ b/resources/views/pdf/req_log_page_1_primayan.blade.php @@ -222,8 +222,9 @@
@php - if(!empty($logoPerusahaan->path)) { - $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path))); + $logoPath = !empty($logoPerusahaan->path) ? storage_path('app/public/' . $logoPerusahaan->path) : null; + if (!empty($logoPath) && is_file($logoPath)) { + $imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents($logoPath)); echo ''; } @endphp