@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'] ?? ''); // Foot Logo Path $footerLogoPath = \App\Models\Setting::where('key', 'app_logo')->value('value'); $footerLogoUrl = $footerLogoPath ? Storage::url($footerLogoPath) : null; // Payment logos list $paymentLogosVisible = \App\Models\Setting::where('key', 'payment_logos_is_visible')->value('value'); $paymentLogosVisible = $paymentLogosVisible === null ? '1' : $paymentLogosVisible; $paymentLogosJson = \App\Models\Setting::where('key', 'payment_logos')->value('value'); $paymentLogos = $paymentLogosJson ? json_decode($paymentLogosJson, true) : []; if (!is_array($paymentLogos)) { $paymentLogos = []; } @endphp {{-- ============================================================ --}} {{-- PAYMENT LOGOS SECTION (Di atas Footer) --}} {{-- ============================================================ --}} @if($paymentLogosVisible == '1') @endif @php $footerTagline = \App\Models\Setting::where('key', 'store_tagline')->value('value') ?: 'Pusat Produk Digital Premium'; $storeDesc = \App\Models\Setting::where('key', 'store_description')->value('value') ?: 'Platform marketplace digital terpercaya untuk kebutuhan akun premium, e-course, dan produk digital berkualitas tinggi.'; $socialWa = \App\Models\Setting::where('key', 'store_wa')->value('value'); $socialIg = \App\Models\Setting::where('key', 'social_ig')->value('value'); $socialFb = \App\Models\Setting::where('key', 'social_fb')->value('value'); $storePhone = \App\Models\Setting::where('key', 'store_phone')->value('value'); $storeEmail = \App\Models\Setting::where('key', 'store_email')->value('value'); $storeAddress = \App\Models\Setting::where('key', 'store_address')->value('value'); $footerPages = \App\Models\Page::where('status', 'published')->where('show_in_footer', true)->get(); $footerCategories = \App\Models\Category::where('is_active', true)->take(5)->get(); $footerLogoUrl = $appLogo ? Storage::url($appLogo) : null; @endphp @stack('scripts')