@php $siteName = \App\Models\Setting::where('key', 'store_name')->value('value') ?? config('app.name', 'DigiShop'); $siteDesc = \App\Models\Setting::where('key', 'store_description')->value('value') ?? 'Marketplace produk digital terbaik.'; $appLogo = \App\Models\Setting::where('key', 'app_logo')->value('value'); $favicon = $appLogo ? Storage::url($appLogo) : asset('favicon.ico'); @endphp @yield('title', $siteName) @yield('schema') @vite(['resources/css/app.css', 'resources/js/app.js'])
@php $sessionCartRaw = session()->get('cart', []); $initialCartCount = auth()->check() ? auth()->user()->carts()->sum('quantity') : (empty($sessionCartRaw) ? 0 : (array_values($sessionCartRaw) === $sessionCartRaw ? count($sessionCartRaw) : array_sum($sessionCartRaw))); @endphp
@auth @if(auth()->user()->role === 'admin' || auth()->user()->is_admin) @endif @else @endauth
{{ $slot }}
@php $s = \App\Models\Setting::all()->pluck('value', 'key'); $storeAbout = $s['store_about'] ?? ''; $storeAddress = $s['store_address'] ?? ''; $storePhone = $s['store_phone'] ?? ''; $storeWa = preg_replace('/[^0-9]/', '', $s['whatsapp_number'] ?? ''); $footerLogoPath = \App\Models\Setting::where('key', 'app_logo')->value('value'); $footerLogoUrl = $footerLogoPath ? Storage::url($footerLogoPath) : null; $paymentLogosVisible = \App\Models\Setting::where('key', 'payment_logos_is_visible')->value('value') ?? '1'; $paymentLogosJson = \App\Models\Setting::where('key', 'payment_logos')->value('value'); $paymentLogos = $paymentLogosJson ? json_decode($paymentLogosJson, true) : []; if (!is_array($paymentLogos)) { $paymentLogos = []; } @endphp @if($paymentLogosVisible == '1') @endif @php $footerTagline = $s['store_tagline'] ?? 'Pusat Produk Digital Premium'; $storeDesc = $s['store_description'] ?? 'Platform marketplace digital terpercaya.'; $storePhone = $s['store_phone'] ?? ''; $storeEmail = $s['store_email'] ?? ''; $storeAddress = $s['store_address'] ?? ''; $storeWa = preg_replace('/[^0-9]/', '', $s['whatsapp_number'] ?? ''); $socialIg = $s['social_instagram'] ?? ''; $socialFb = $s['social_facebook'] ?? ''; $socialTt = $s['social_tiktok'] ?? ''; $socialYt = $s['social_youtube'] ?? ''; $footerPages = \App\Models\Page::published()->where('show_in_footer', true)->orderBy('title')->get(); $footerCategories = \App\Models\Category::where('is_active', true)->take(5)->get(); @endphp @stack('scripts')