@extends('super-admin.layout') @section('title', 'Customer Report') @section('subtitle', $summary['period']) @section('content')

Customer Summary

{{ number_format($summary['total_customers']) }}
Active Customers
{{ number_format($summary['new_customers']) }}
New Customers
₦{{ number_format($summary['total_revenue'], 0) }}
Total Revenue
₦{{ number_format($summary['avg_customer_value'], 0) }}
Avg Customer Value
{{ number_format($summary['avg_order_frequency'], 1) }}
Avg Order Frequency
₦{{ number_format($summary['avg_order_value'], 0) }}
Avg Order Value
{{ number_format($summary['customer_retention_rate'], 1) }}%
Retention Rate

Export Options

Customer Segmentation

{{ $segmentation['new_customers'] }}
New Customers
{{ $segmentation['returning_customers'] }}
Returning
{{ $segmentation['loyal_customers'] }}
Loyal
{{ $segmentation['high_value'] }}
High Value
{{ $segmentation['at_risk'] }}
At Risk

Order Frequency Distribution

@foreach($frequencyAnalysis as $frequency => $data) @endforeach
Frequency Customers Total Revenue Avg Value
{{ $frequency }} {{ number_format($data['count']) }} ₦{{ number_format($data['total_revenue'], 0) }} ₦{{ number_format($data['avg_value'], 0) }}

Top Customers by Value

@foreach($customers->take(50) as $customer) @endforeach
Customer Contact Orders Total Spent Avg Order Lifetime Value Last Order
{{ $customer['name'] }}
Joined {{ \Carbon\Carbon::parse($customer['registration_date'])->format('M d, Y') }}
{{ $customer['email'] }}
{{ $customer['phone'] }}
{{ number_format($customer['total_orders']) }} ₦{{ number_format($customer['total_spent'], 0) }} ₦{{ number_format($customer['avg_order_value'], 0) }} ₦{{ number_format($customer['lifetime_value'], 0) }} @if($customer['last_order']) {{ \Carbon\Carbon::parse($customer['last_order'])->format('M d, Y') }} @if($customer['days_since_last_order'])
{{ $customer['days_since_last_order'] }} days ago
@endif @else Never @endif
@if($customers->count() > 50)
Showing top 50 customers of {{ $customers->count() }} total customers
@endif
@if($newCustomers->count() > 0)

New Customers in Period

@foreach($newCustomers->take(20) as $customer) @endforeach
Customer Registration First Order Orders Total Spent Days to First Order
{{ $customer['name'] }}
{{ $customer['email'] }}
{{ \Carbon\Carbon::parse($customer['registration_date'])->format('M d, Y') }} @if($customer['first_order_date']) {{ \Carbon\Carbon::parse($customer['first_order_date'])->format('M d, Y') }} @else No orders yet @endif {{ number_format($customer['orders_count']) }} ₦{{ number_format($customer['total_spent'], 0) }} @if($customer['days_to_first_order'] !== null) {{ $customer['days_to_first_order'] }} days @else - @endif
@endif
@endsection