Dev/v1.2 (#4)
Build Docker Image / build-backend (push) Successful in 1m56s
Build Docker Image / build-frontend (push) Successful in 1m55s

Co-authored-by: ISMAIL MASSERAN <topaz@Mac.dlinkrouter.local>
Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
2026-07-06 12:50:55 +08:00
parent e77712105c
commit d06c4701a4
190 changed files with 5365 additions and 26981 deletions
+8 -5
View File
@@ -56,11 +56,14 @@ class LetterService
public function prepareViewData(array $overrides = []): array
{
$logoPath = $overrides['logoPath'] ?? config('mail.logo_path');
$signaturePath = $overrides['signaturePath'] ?? config('letter.signature_path');
return array_merge([
'letterLayout' => LetterLayout::resolve(),
'logoPath' => $logoPath,
'logoUrl' => $this->resolveLogoDataUri($logoPath),
'logoUrl' => $this->resolveImageDataUri($logoPath),
'signaturePath' => $signaturePath,
'signatureUrl' => $this->resolveImageDataUri($signaturePath),
'organizationAddress' => $overrides['organizationAddress'] ?? null,
'organizationContact' => $overrides['organizationContact'] ?? null,
], $overrides);
@@ -97,14 +100,14 @@ class LetterService
return $browsershot;
}
protected function resolveLogoDataUri(?string $logoPath): ?string
protected function resolveImageDataUri(?string $path): ?string
{
if (empty($logoPath) || ! file_exists($logoPath)) {
if (empty($path) || ! file_exists($path)) {
return null;
}
$mime = mime_content_type($logoPath) ?: 'image/svg+xml';
$mime = mime_content_type($path) ?: 'image/svg+xml';
return 'data:'.$mime.';base64,'.base64_encode(file_get_contents($logoPath));
return 'data:'.$mime.';base64,'.base64_encode(file_get_contents($path));
}
}