@php
$themeSettings = $themeSettings ?? (object) [
'site_name' => config('app.name', 'IFRAP'),
'logo_path' => null,
'logo1_path' => null,
'logo2_path' => null,
];
$resolveThemeLogo = function ($path) {
if (! $path) {
return null;
}
return \Illuminate\Support\Str::startsWith($path, ['http://', 'https://', '/'])
? $path
: asset('storage/' . ltrim($path, '/'));
};
$fallbackLogo1 = asset('theme/default/assets/media/images/Header-Logo-1.png');
$fallbackLogo2 = asset('theme/default/assets/media/images/logo_ifrap.png');
$logo1 = $resolveThemeLogo($themeSettings->logo1_path ?? $themeSettings->logo_path ?? null) ?: $fallbackLogo1;
$logo2 = $resolveThemeLogo($themeSettings->logo2_path ?? null) ?: $fallbackLogo2;
@endphp