@extends('layouts.admin') @section('title', 'Customer Profile — ' . $customer->name) @section('content')
← Back to Customer Directory
{{ substr($customer->name, 0, 1) }}

{{ $customer->name }} Active Customer

Member since {{ $customer->created_at ? $customer->created_at->format('M d, Y') : 'Recent' }} · Customer ID: #CUST-{{ $customer->id }}
Lifetime Value (Total Spent)
₹{{ number_format($totalSpent, 2) }}
Cumulative purchases
Total Orders Placed
{{ $ordersCount }} orders
All-time order count
Average Order Value (AOV)
₹{{ number_format($avgOrderValue, 2) }}
Spend per order average

Contact & Account Details

Full Name {{ $customer->name }}
Email Address {{ $customer->email }}
Mobile Phone {{ $customer->phone ?: 'Not provided' }}
Registration Date {{ $customer->created_at ? $customer->created_at->format('F d, Y h:i A') : 'N/A' }}

Primary Shipping Address

@if($recentAddress)
{{ $recentAddress->customer_name }}
{{ $recentAddress->shipping_address }}
{{ $recentAddress->city }}, {{ $recentAddress->state }} — {{ $recentAddress->pincode }}
Phone: {{ $recentAddress->customer_phone }}
@else
No saved shipping addresses found yet. Address will automatically populate upon first order checkout.
@endif

Order History

@if($customer->orders->isEmpty())
This customer has not placed any orders yet.
@else
@foreach($customer->orders as $ord) @endforeach
Order Number Order Date Items Count Total Amount Payment Status Order Status Actions
#{{ $ord->order_number }} {{ $ord->created_at ? $ord->created_at->format('M d, Y H:i') : '—' }} {{ $ord->items->sum('quantity') }} items ₹{{ number_format($ord->total_amount, 2) }} {{ strtoupper($ord->payment_method) }} {{ ucfirst($ord->payment_status) }} {{ ucfirst($ord->order_status) }}
@endif
@endsection