@php $siteTitle = \App\Models\Setting::cached('site_title') ?? config('app.name','KalaRhea'); $siteTagline = \App\Models\Setting::cached('site_tagline') ?? 'Fashion For Your Story'; $siteFavicon = \App\Models\Setting::cached('site_favicon'); $siteLogo = \App\Models\Setting::cached('site_logo'); $footerContent = json_decode(\App\Models\Setting::cached('page_content_footer') ?? '{}', true) ?? []; $defaultSocials = [ ['name' => 'Instagram', 'url' => '#', 'icon' => 'fa-brands fa-instagram'], ['name' => 'TikTok', 'url' => '#', 'icon' => 'fa-brands fa-tiktok'], ['name' => 'Facebook', 'url' => '#', 'icon' => 'fa-brands fa-facebook-f'], ['name' => 'YouTube', 'url' => '#', 'icon' => 'fa-brands fa-youtube'], ]; $socials = !empty($footerContent['footer_social_media']) ? (array) $footerContent['footer_social_media'] : $defaultSocials; $footerEcommerce = array_values(array_filter( (array) ($footerContent['footer_ecommerce'] ?? []), fn ($s) => is_array($s) && (trim((string) ($s['name'] ?? '')) !== '' || trim((string) ($s['url'] ?? '')) !== '' || ! empty($s['image'])) )); if ($footerEcommerce === [] && ! empty($footerContent['footer_ecommerce_image'])) { // Kompatibilitas dengan data lama (satu gambar e-commerce). $footerEcommerce = [['name' => 'E-commerce', 'url' => '#', 'image' => $footerContent['footer_ecommerce_image']]]; } @endphp {{-- e() mencegah stored XSS: section title bisa memuat nama produk/blog yang dikontrol admin. Blade @yield mengeluarkan konten mentah. --}}