@extends('admin.layouts.app') @section('page-title', 'Customers') @section('content')

Customer List

{{ $customers->count() }}
Total Customers
@php $newThisMonth = $customers->filter(function($customer) { return $customer->created_at->format('Y-m') === now()->format('Y-m'); })->count(); @endphp {{ $newThisMonth }}
New This Month
@php $activeCustomers = $customers->where('status', 'active')->count(); @endphp {{ $activeCustomers }}
Active Customers
@php $premiumCount = $customers->where('customer_type', 'premium')->count(); @endphp {{ $premiumCount }}
Premium Customers
@if(!empty($status)) @endif
@forelse($customers as $c) @empty @endforelse
Customer Info Customer ID Create Date Status Actions
{{ strtoupper(substr($c->customer_name,0,1)) }}
{{ $c->customer_name }}
@if($c->customer_type == 'premium') Premium Customer @else Regular Customer @endif
{{ $c->email }}
{{ $c->mobile_no }}
{{ $c->orders->count() }} orders • ₹{{ number_format($c->orders->sum('ttl_amount'), 2) }} total
{{ $c->customer_id }} {{ $c->created_at ? $c->created_at->format('d-m-Y') : '-' }} @if($c->status === 'active') Active @else Inactive @endif
@csrf
No customers found.
@endsection