@push('title') Customer Management @endpush @can('view_customer_management')
@if (session('success')) @endif
Customer Information
@if ($customers->profile_picture) Profile Picture @else
@endif
@if ($customers->is_blocked) Blocked @else Active @endif

{{ $customers->name }}

{{ $customers->email }} @if ($customers->email_verified_at) Verified @else Unverified @endif

{{ $customers->created_at->format('M d, Y') }}

{{ $customers->updated_at->format('M d, Y g:i A') }}

Contact Details
@if ($customers->customerInfo)

{{ $customers->customerInfo->first_name ?? 'Not provided' }}

{{ $customers->customerInfo->last_name ?? 'Not provided' }}

{{ $customers->customerInfo->phone ?? 'Not provided' }}

{{ $customers->customerInfo->address ?? 'Not provided' }}

{{ $customers->customerInfo->city ?? 'Not provided' }}

{{ $customers->customerInfo->state ?? 'Not provided' }}

{{ $customers->customerInfo->postal_code ?? 'Not provided' }}

@else

No additional contact information available.

@endif
Order Statistics

{{ $customers->orders->count() }}

Total Orders

{{ number_format($customers->orders->sum('total_amount'), 2) }} {{ $config->currancy }}

Total Spent


Completed Orders {{ $customers->orders->where('order_status', 'completed')->count() }}
Pending Orders {{ $customers->orders->where('order_status', 'pending')->count() }}
Cancelled Orders {{ $customers->orders->where('order_status', 'cancelled')->count() }}
@if ($customers->orders->count() > 0)
Average Order Value: {{ number_format($customers->orders->avg('total_amount'), 2) }} {{ $config->currancy }}
@endif
Order History
{{ $customers->orders->count() }} Orders
@if ($customers->orders->count() > 0)
@foreach ($customers->orders->sortByDesc('created_at') as $order) @endforeach
Order ID Date Items Total Amount Payment Status Order Status Payment Method
#{{ $order->id }} {{ $order->created_at->format('M d, Y') }} {{ $order->orderItems->count() }} items {{ number_format($order->total_amount, 2) }} {{ $config->currancy }} @php $paymentClass = match ($order->payment_status) { 'paid' => 'success', 'pending' => 'warning', 'failed' => 'danger', default => 'secondary', }; @endphp {{ ucfirst($order->payment_status ?? 'N/A') }} @php $statusClass = match ($order->order_status) { 'completed' => 'success', 'pending' => 'warning', 'processing' => 'info', 'cancelled' => 'danger', default => 'secondary', }; @endphp {{ ucfirst($order->order_status) }} {{ ucwords(str_replace('_', ' ', $order->payment_option) ?? 'N/A') }}
@else
No Orders Found

This customer hasn't placed any orders yet.

@endif
@endcan