{{-- Component: components/navbar.blade.php Itemku style marketplace navbar. --}} @php /** @var \App\Models\User|null $authUser */ $authUser = Auth::user(); $navCategories = isset($categories) ? $categories : collect(); $isAdminRoute = request()->routeIs('admin.*'); $isAdminSettingsRoute = $authUser?->isAdmin() && request()->routeIs('settings.*'); $cartItems = collect(); $cartCount = 0; $avatarFallback = 'https://ui-avatars.com/api/?name=' . urlencode($authUser?->name ?? 'User') . '&background=08399b&color=fff'; if ($authUser) { $cartCount = (int) \App\Models\Cart::query() ->where('user_id', $authUser->id) ->sum('quantity'); $cartItems = \App\Models\Cart::query() ->where('user_id', $authUser->id) ->with('product.seller') ->latest() ->take(3) ->get(); } @endphp @push('styles') @endpush {{-- ═══ MOBILE SIDEBAR DRAWER ═══ --}} {{-- ═══ DESKTOP NAVBAR ═══ --}} {{-- 2. Main Bar (Blue) --}} {{-- Mobile Menu & Logo --}} {{ config('app.name', 'Itemku') }} {{-- Search Bar --}} @if(! $isAdminRoute && ! $isAdminSettingsRoute) ENTER {{-- Trending Chips (Absolute positioned below search to not expand nav height) --}} cheap robux growtopia genshin impact steam mobile legends @endif {{-- Right Icons (Auth, Chat, Cart) --}} @if($authUser) @if(! $isAdminRoute && ! $isAdminSettingsRoute) {{-- Search Mobile --}} {{-- Notifications --}} Notifikasi Lihat semua Klik ikon notifikasi untuk memuat pesan terbaru. {{-- Chat --}} @if(! $authUser?->isAdmin()) {{-- Cart --}} @if($cartCount > 0) {{ $cartCount > 99 ? '99+' : $cartCount }} @endif Keranjang Lihat semua @if($cartItems->isNotEmpty()) @foreach($cartItems as $item) {{ $item->product?->name ?? 'Produk' }} {{ $item->quantity }} x Rp {{ number_format((float) ($item->product?->price ?? 0), 0, ',', '.') }} @endforeach @else Keranjang kosong @endif @endif @endif {{-- User Avatar Dropdown --}} {{ $authUser?->name ?? 'User' }} {{ $authUser->name }} {{ $authUser->email }} @if($authUser->isAdmin()) Panel Admin Kelola Akun Transaksi Banner @else Dashboard Pesanan Saya Wallet @if($authUser->isSellerAccount()) Dashboard Penjual @else Daftar Jadi Penjual @endif @endif {{-- Pengaturan Akun (visible to all authenticated users) --}} @if(Route::has('settings.account')) Pengaturan Akun @else Pengaturan Akun @endif @csrf Keluar @else {{-- Guest --}} Masuk Daftar @endif {{-- 3. Category Bar (Dark Blue) --}} {{-- Kategori Dropdown --}} Kategori {{-- Mega Menu (Hover to open) --}} @if($navCategories->isNotEmpty()) @foreach($navCategories as $cat) {{ $cat->name }} @endforeach Semua Kategori @endif Temukan Produk Digital Terbaik Game Top Up Mobile Legends, Free Fire, PUBG... Game Key & Sharing Steam, EA, Epic Games... Roblox Robux, Item, Pet, Akun... Voucher & Gift Card Steam Wallet, Google Play... {{-- Horizontal Links --}} Game Key Roblox Item Currency Top Up Account Gift Cards @push('scripts') @endpush
{{ $authUser->name }}
{{ $authUser->email }}