@php
$settingsService = app(\App\Services\SettingsService::class);
$siteName = $settingsService->get('site_name', config('app.name'));
$logoSetting = $settingsService->get('primary_logo') ?: $settingsService->get('logo_url');
$logo_candidates = [];
if (!empty($logoSetting)) {
$relative_logo = ltrim((string) $logoSetting, '/');
$logo_candidates[] = storage_path('app/public/'.$relative_logo);
// Email clients cannot reliably show SVG — prefer a PNG sibling when available.
if (str_ends_with(strtolower($relative_logo), '.svg')) {
$logo_candidates[] = storage_path('app/public/'.preg_replace('/\.svg$/i', '.png', $relative_logo));
}
}
$logo_candidates[] = storage_path('app/public/settings/branding/ndarama-logo.png');
$logo_candidates[] = public_path('frontend/images/logo/logo.png');
$logo_candidates[] = public_path('frontend/images/logo/logo-2.png');
$logo_path = null;
foreach ($logo_candidates as $candidate_path) {
if (!$candidate_path || !is_file($candidate_path)) {
continue;
}
$extension = strtolower(pathinfo($candidate_path, PATHINFO_EXTENSION));
if ($extension === 'svg') {
continue;
}
$logo_path = $candidate_path;
break;
}
// Embed as CID so the logo prints inside the email (not a remote URL).
$logo_url = null;
if ($logo_path && isset($message)) {
$logo_url = $message->embed($logo_path);
} elseif ($logo_path) {
$storage_public = storage_path('app/public');
if (str_starts_with($logo_path, $storage_public)) {
$relative = ltrim(str_replace('\\', '/', substr($logo_path, strlen($storage_public))), '/');
$logo_url = asset('storage/'.$relative);
} else {
$relative = ltrim(str_replace('\\', '/', substr($logo_path, strlen(public_path()))), '/');
$logo_url = asset($relative);
}
}
@endphp
{{ $email_title ?? $siteName }}
@if($logo_url)
@else
{{ $siteName }}
@endif
|
|
@yield('content')
|
|
{{ $siteName }} · Event registration
|
|