@yield('page-title', 'Dashboard')
@hasSection('header-search') @endif
@if(isset($demoMode) && $demoMode)
ডেমো
@endif
@else
@endif
@php
$user = Auth::guard('admin')->user();
$vendorId = $user->vendor_id ?? null;
$notificationCount = 0;
if ($vendorId) {
$orderIds = \App\Models\OrderDetails::whereIn('product_id', function($query) use ($vendorId) {
$query->select('id')->from('products')->where('vendor_id', $vendorId);
})->distinct()->pluck('order_id')->toArray();
$newOrders = \App\Models\Order::whereIn('id', $orderIds)
->whereIn('order_status', ['1', '2', '3'])
->where('created_at', '>=', \Carbon\Carbon::now()->subDay())
->count();
$pendingWithdrawals = \App\Models\VendorWithdrawal::where('vendor_id', $vendorId)
->where('status', 'pending')->count();
$pendingRefunds = \App\Models\Refund::where('vendor_id', $vendorId)
->where('status', 'pending')->count();
$notificationCount = $newOrders + $pendingWithdrawals + $pendingRefunds;
if ($vendor->verification_status != 'approved') {
$notificationCount++;
}
}
@endphp
@if($notificationCount > 0)
{{ $notificationCount > 9 ? '9+' : $notificationCount }}
@endif
@stack('header-notifications')
@php
$user = Auth::guard('admin')->user();
@endphp
@if($user && $user->image)
Admin
{{ $user->name ?? $vendor->owner_name }}
{{ session('success') }}
@endif
@if(session('error') && !session('demo_mode_blocked'))
{{ session('error') }}
@endif
@yield('content')