@extends('layouts.admin') @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') }}
{{-- KPI Cards --}}
{{ $salesChange >= 0 ? '↑' : '↓' }} {{ abs($salesChange) }}%
{{ price($totalSales, false) }}
Total Revenue All time
{{ $ordersChange >= 0 ? '↑' : '↓' }} {{ abs($ordersChange) }}%
{{ $todayOrders }}
Today's Orders {{ $totalOrders }} total
{{ $customerChange >= 0 ? '↑' : '↓' }} {{ abs($customerChange) }}%
{{ $totalCustomers }}
Total Customers {{ $totalVendors }} vendors
{{ $productChange >= 0 ? '↑' : '↓' }} {{ abs($productChange) }}%
{{ $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', 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', }; @endphp @empty @endforelse
OrderCustomerAmountStatusDate
#{{ $order->order_number }}
{{ strtoupper(substr($order->customer->name, 0, 1)) }}
{{ $order->customer->name }}
{{ price($order->total, false) }} {{ ucfirst($order->status) }} {{ $order->created_at->diffForHumans() }}
No orders yet
Order Pipeline
Pending
{{ $pendingOrders }}
Processing
{{ $processingOrders }}
Shipped
{{ $shippedOrders }}
Delivered
{{ $deliveredOrders }}
Manage Orders
Vendors
{{ $approvedVendors }}
Active
{{ $pendingVendors }}
Pending
Manage Vendors
{{-- 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->name }}
{{ price($product->total_revenue, false) }}
{{ $product->total_sold }} sold
@endforeach
@else
No product sales data available
@endif
@push('scripts') @endpush @endsection