@extends('layouts.vendor') @section('page-title', 'Dashboard') @push('styles') @endpush @section('content')
{{-- Welcome Section --}}
@php $user = auth()->user(); $avatarUrl = $user->avatar ? (str_starts_with($user->avatar, 'http') ? $user->avatar : (str_starts_with($user->avatar, '/') ? asset($user->avatar) : asset('storage/' . $user->avatar))) : ''; $initials = strtoupper(substr($user->name, 0, 1) . (strpos($user->name, ' ') !== false ? substr($user->name, strpos($user->name, ' ') + 1, 1) : '')); @endphp
@if($avatarUrl) {{ $user->name }} @else {{ $initials }} @endif
Welcome back
{{ $user->name }}
{{ now()->format('l, F j, Y') }}
View Your Storefront
{{-- KPI Cards --}}
{{ $salesChange >= 0 ? '↑' : '↓' }} {{ abs($salesChange) }}%
{{ price($totalSales, false) }}
Total Revenue {{ price($thisMonthSales, false) }} this month
{{ $ordersChange >= 0 ? '↑' : '↓' }} {{ abs($ordersChange) }}%
{{ $todayOrders }}
Today's Orders {{ $totalOrders }} total
Pending
{{ price($wallet->balance, false) }}
Wallet Balance {{ price($wallet->total_earned, false) }} earned
{{ $pendingOrders }} pending
{{ $totalProducts }}
Total Products {{ $publishedProducts }} published
{{-- Revenue Chart --}}
Revenue Overview
Last 30 days performance
{{ price($thisMonthSales, false) }}
{{ $monthlyGrowth >= 0 ? '↑' : '↓' }} {{ abs($monthlyGrowth) }}% vs last month
{{-- Orders Chart + Status Distribution --}}
Daily Orders
Last 30 days volume
Order Status
Current distribution
@foreach($statusDistribution as $status) @php $color = match($status['status']) { 'Pending' => '#eab308', 'Processing' => '#3b82f6', 'Shipped' => '#8b5cf6', 'Delivered' => '#22c55e', 'Cancelled' => '#ef4444', 'Refunded' => '#6b7280', 'Confirmed' => '#6366f1', default => '#9ca3af' }; @endphp
{{ $status['status'] }} {{ $status['count'] }}
@endforeach
{{-- Recent Orders + Pipeline --}}
Recent Orders
Latest transactions
View All →
@forelse($recentOrders as $order) @php $badgeClass = match($order->status) { 'pending' => 'badge-yellow', 'processing' => 'badge-blue', 'shipped' => 'badge-purple', 'delivered' => 'badge-green', 'confirmed' => 'badge-indigo', 'cancelled', 'refunded' => 'badge-red', default => 'badge-gray', }; $itemTotal = $order->items->where('vendor_id', $vendor->id)->sum('subtotal'); @endphp @empty @endforelse
OrderCustomerAmountStatusDate
#{{ $order->order_number }}
{{ strtoupper(substr($order->customer->name, 0, 1)) }}
{{ $order->customer->name }}
{{ price($itemTotal, false) }} {{ ucfirst($order->status) }} {{ $order->created_at->diffForHumans() }}
No orders yet
Order Pipeline
Pending
{{ $pendingOrders }}
Processing
{{ $processingOrders }}
Shipped
{{ $shippedOrders }}
Delivered
{{ $deliveredOrders }}
Manage Orders
@if($lowStockProducts->count() > 0)
Low Stock Alert
@foreach($lowStockProducts as $product)
{{ $product->name }} {{ $product->stock_quantity }}
@endforeach
Manage Inventory
@endif
{{-- Top Products --}}
Top Products
By revenue generated
View All →
@if($topProducts->count() > 0)
@foreach($topProducts as $i => $product) @php $rankClass = $i === 0 ? 'rank-1' : ($i === 1 ? 'rank-2' : ($i === 2 ? 'rank-3' : '')); @endphp
{{ $i + 1 }}
{{ $product->product_name }}
{{ price($product->total_revenue, false) }}
{{ $product->total_sold }} sold
@endforeach
@else
No product sales data available
@endif
@push('scripts') @endpush @endsection