@extends('layouts.admin') @section('content')

Customer Reports

Total Customers

{{ number_format($totalCustomers) }}

New Customers

{{ number_format($newCustomers) }}

Active Customers

{{ number_format($topCustomers->count()) }}

Top Customers by Spending

@foreach($topCustomers as $customer)

{{ $customer->name }}

@if($customer->phone){{ $customer->phone }}@endif @if($customer->email && $customer->phone) • @endif @if($customer->email)@endif

Rs.{{ number_format($customer->total_spent, 2) }}

{{ $customer->total_transactions }} trans

@endforeach

Customer Acquisition Trend

@if($customerAcquisition->count() > 0) @else

No data available

@endif

Loyal Customers

Customers with loyalty points

@foreach($loyalCustomers as $customer)

{{ $customer->name }}

@if($customer->phone) {{ $customer->phone }} @endif @if($customer->email) {{ $customer->email }} @endif
{{ number_format($customer->loyalty_points) }} pts
Total Spent: @php $totalSpent = $customer->sales()->where('status', 'completed')->sum('total'); @endphp Rs.{{ number_format($totalSpent, 2) }}
Last Purchase: @php $lastSale = $customer->sales()->where('status', 'completed')->latest()->first(); @endphp @if($lastSale) {{ $lastSale->created_at->diffForHumans() }} @else Never @endif
@endforeach
@endsection @push('scripts') @endpush