@php use Illuminate\Support\Str; $footer = $footer ?? []; $basePath = rtrim($basePath ?? '', '/'); $siteName = $siteName ?? 'qpost'; $siteDescription = $siteDescription ?? ''; $poweredBy = $poweredBy ?? config('app.name', 'qpost'); $fileUrlBase = rtrim($fileUrlBase ?? '', '/'); $logoPath = trim((string) ($logoPath ?? '')); $logoUrl = $logoPath !== '' && $fileUrlBase !== '' ? $fileUrlBase . '/' . ltrim($logoPath, '/') : null; $footerCompany = $footer['company'] ?? []; $footerContact = $footer['contact'] ?? []; $footerInfo = $footer['info'] ?? []; $footerMenus = $footer['menus'] ?? []; $footerSocials = $footer['socials'] ?? []; $infoItems = collect($footerInfo) ->filter(fn ($item) => filled(data_get($item, 'label')) || filled(data_get($item, 'value'))) ->values(); $toSiteUrl = static function (string $href) use ($basePath): string { $href = trim($href); if ($href === '') { return '#'; } if (Str::startsWith($href, ['http://', 'https://', '//', '#'])) { return $href; } if ($basePath === '') { return url('/' . ltrim($href, '/')); } return rtrim($basePath, '/') . '/' . ltrim($href, '/'); }; $socialIcons = [ 'instagram' => '', 'youtube' => '', 'facebook' => '', ]; @endphp