@php if(session()->has('pincode_details')) { $pincode_details = session()->get('pincode_details'); $pincode = isset($pincode_details['pincode']) ? $pincode_details['pincode'] : ''; $city = isset($pincode_details['city']) ? $pincode_details['city'] : ''; } else { $pincode = ''; $city = ''; } $currentLocation = session()->get('currentLocation'); $currentPincode = isset($currentLocation['pincode']) ? $currentLocation['pincode'] : ''; $currentCity = isset($currentLocation['city']) ? $currentLocation['city'] : ''; $hasLocation = !empty($city) || !empty($pincode); // Optimized DB Queries: Run only if user is logged in $authUserId = Auth::check() ? Auth::user()->id : ""; $authUserName = Auth::check() ? Auth::user()->name : ""; $authUserImage = Auth::check() ? Auth::user()->avatar : ""; $chekPartner = null; $userNotification = collect(); $userNotificationCount = 0; if(Auth::check()) { $chekPartner = \App\Models\Affiliate::where('user_id', $authUserId)->first(); $userNotification = App\Models\FirebaseNotification::where('is_read', 0) ->where('receiver_id', $authUserId) ->where('send_by', 'admin') ->latest() ->limit(5) ->get(); // FIX: reuse the already-loaded collection instead of second DB query $userNotificationCount = $userNotification->count(); } @endphp @if(get_setting('topbar_banner') != null)
@endif
Menu
@guest @else
@include('frontend.partials.message')
@php $desktop_phone = isset(auth()->user()->phone) ? auth()->user()->phone : ''; $desktop_seller_row = null; $desktop_customer_row = null; if(!empty($desktop_phone)){ $desktop_seller_row = App\Models\User::where('phone', $desktop_phone)->where('user_type','seller')->first(); $desktop_customer_row = App\Models\User::where('phone', $desktop_phone)->where('user_type','customer')->first(); } $desktop_on_seller_page = request()->is('seller') || request()->is('seller/*'); @endphp @if(!empty($desktop_seller_row)) @if($desktop_on_seller_page) @else @endif @elseif(Auth::user()->user_type == 'customer') @endif @endguest
@if(Route::currentRouteName() != 'home')
@include('frontend.partials.category_menu')
@endif
{{-- CSRF --}} @if(!isset($__csrfMetaAdded)) @php $__csrfMetaAdded = true; @endphp @endif {{-- ================================================================ LOCATION MODAL — WIDER & SHORTER SPLIT-SCREEN DESIGN (CENTERED) ================================================================ --}} @section('script') @endsection