@extends('admin.layouts.app') @section('title', 'Dashboard') @section('content')
{{-- Stat cards --}}
@php $cards = [ ['label' => 'Orders Today', 'value' => $stats['orders_today'], 'icon' => '🛒', 'color' => 'bg-indigo-50 text-indigo-600'], ['label' => 'Revenue Today', 'value' => '₹'.number_format($stats['revenue_today'],2), 'icon' => '💰', 'color' => 'bg-green-50 text-green-600'], ['label' => 'Orders (Month)', 'value' => $stats['orders_month'], 'icon' => '📦', 'color' => 'bg-amber-50 text-amber-600'], ['label' => 'Conversion Rate', 'value' => $stats['conversion_rate'].'%', 'icon' => '📈', 'color' => 'bg-purple-50 text-purple-600'], ]; @endphp @foreach($cards as $card)
{{ $card['label'] }} {{ $card['icon'] }}
{{ $card['value'] }}
@endforeach
{{-- Funnel + Orders --}}
{{-- Checkout Funnel --}}

Today's Funnel

@php $funnel = $stats['funnel']; $funnelSteps = [ ['label' => 'Checkout Started', 'key' => 'checkout_started'], ['label' => 'OTP Verified', 'key' => 'otp_verified'], ['label' => 'Payment Initiated', 'key' => 'payment_initiated'], ['label' => 'Payment Success', 'key' => 'payment_success'], ]; $max = max(1, $funnel['checkout_started'] ?? 1); @endphp
@foreach($funnelSteps as $step) @php $val = $funnel[$step['key']] ?? 0; $pct = round(($val / $max) * 100); @endphp
{{ $step['label'] }} {{ $val }}
@endforeach
{{-- Recent Orders --}}

Recent Orders

View all →
@forelse($recentOrders as $order) @empty @endforelse
Order Customer Amount Status
#{{ $order->shopify_order_number ?? $order->id }} {{ $order->customer?->first_name ?? '—' }} {{ $order->customer?->last_name ?? '' }} ₹{{ number_format($order->total_amount, 2) }} $order->status === 'confirmed', 'bg-amber-100 text-amber-700' => $order->status === 'pending', 'bg-red-100 text-red-700' => $order->status === 'cancelled', 'bg-slate-100 text-slate-700' => !in_array($order->status, ['confirmed','pending','cancelled']), ])>{{ ucfirst($order->status) }}
No orders yet
@endsection