@extends('backend.layout') @section('backend_content')

Business Dashboard

Live overview of shops, products, orders, and revenue {{-- Shop Management Dropdown for Non-Super Admin Users --}} @if (!$isSuperAdmin && $accessibleShops->count() > 0)
Your Shops:
@foreach ($accessibleShops as $shop) {{ $shop->name }} @endforeach @if ($accessibleShops->count() > 1) All Shops @endif
@elseif ($isSuperAdmin && $accessibleShops->count() > 0)
Total Shops: {{ $accessibleShops->count() }} Manage All Shops
@endif
Manage Orders
Shops

{{ $stats['shops'] }}

Products

{{ $stats['products'] }}

Low stock: {{ $stats['low_stock_products'] }}
Orders

{{ $stats['orders'] }}

Pending: {{ $stats['pending_orders'] }}
Gross Sales

৳{{ number_format($stats['gross_sales'], 0) }}

Completed: {{ $stats['completed_orders'] }}
Revenue Trend (Last 6 Months)
Total: ৳{{ number_format(array_sum($monthlyRevenueSeries), 0) }}
Order Status Split
Pending: {{ $stats['pending_orders'] }} Processing: {{ $stats['processing_orders'] }} Completed: {{ $stats['completed_orders'] }} Cancelled: {{ $stats['cancelled_orders'] }}
Top Shops by Revenue
Top 5
@forelse ($topShops as $row) @empty @endforelse
Shop Qty Revenue
{{ $row->shop_name ?: 'Unknown' }} {{ (int) $row->qty_sold }} ৳{{ number_format((float) $row->revenue, 0) }}
No sales data yet.
Recent Orders
View all
@forelse ($recentOrders as $order) @empty @endforelse
Order Customer Status Amount Date
{{ $order->order_number }} {{ $order->customer_name }} @if ($order->status === 'pending') Pending @elseif ($order->status === 'processing') Processing @elseif ($order->status === 'completed') Completed @elseif ($order->status === 'cancelled') Cancelled @else {{ ucfirst($order->status) }} @endif ৳{{ number_format((float) $order->total_amount, 0) }} {{ \Illuminate\Support\Carbon::parse($order->created_at)->format('M d, Y') }}
No orders found yet.
@endsection @push('backend_css') @endpush @push('backend_js') @endpush