@props([ 'basePath' => '', 'fileUrlBase' => '', 'siteName' => 'qpost', 'siteDescription' => '', 'footer' => [], 'logoPath' => null, 'footerDesign' => 'default', 'footerTone' => 'light', 'poweredBy' => null, 'tenantFooter' => false, ]) @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 ?? '')); $footerDesign = $footerDesign ?? 'default'; $footerTone = $footerTone ?? 'light'; $logoUrl = $logoPath !== '' && $fileUrlBase !== '' ? $fileUrlBase . '/' . ltrim($logoPath, '/') : null; $footerCompany = $footer['company'] ?? []; $footerContact = $footer['contact'] ?? []; $footerInfo = $footer['info'] ?? []; $footerInfoVisible = ! $tenantFooter || (bool) ($footer['show_info'] ?? true); $footerMenus = $footer['menus'] ?? []; $footerSocials = $footer['socials'] ?? []; $infoItems = collect($footerInfo) ->filter(fn ($item) => filled(data_get($item, 'label')) && filled(data_get($item, 'value'))) ->values(); $footerCompanyItems = collect($footerCompany)->filter(fn ($value) => filled($value)); $footerContactItems = collect($footerContact)->filter(fn ($value) => filled($value)); $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