fix: guard missing logo files in request/final log PDF templates
This commit is contained in:
@@ -216,8 +216,9 @@
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@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 '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@@ -216,8 +216,9 @@
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@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 '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@@ -210,8 +210,9 @@
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@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 '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@@ -210,8 +210,9 @@
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@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 '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@@ -224,8 +224,9 @@
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@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 '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
|
||||
}
|
||||
@endphp
|
||||
|
||||
@@ -222,8 +222,9 @@
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@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 '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
|
||||
}
|
||||
@endphp
|
||||
|
||||
Reference in New Issue
Block a user