@extends('layouts.admin') @section('title','Customer insights') @section('content') @php $money = fn (int $cents) => 'AUD '.number_format($cents / 100, 2); $maxMonthly = max(1, (int) $monthly->max('total')); @endphp Customers Segments Build segment
Customers {{ number_format($totals['customers']) }} {{ number_format($totals['new_30d']) }} new in 30d
Buyers {{ number_format($totals['buyers']) }} {{ number_format($totals['never_ordered']) }} never ordered
Repeat rate {{ number_format($totals['repeat_rate'], 1) }}% {{ number_format($totals['repeat_buyers']) }} multi-order
Avg LTV {{ $money($totals['avg_ltv_cents']) }} Avg order {{ $money($totals['avg_order_cents']) }}
Lifetime revenue {{ $money($totals['lifetime_cents']) }} Linked to customers
@foreach($cohorts as $key => $cohort)
{{ $cohort['label'] }} @if(in_array($key, ['at_risk', 'hibernating'], true)) Watch @elseif($key === 'champions') VIP @endif
{{ number_format($cohort['count']) }}

{{ $cohort['description'] }}

@endforeach
@foreach($monthly as $row)
{{ $row->label }} {{ number_format($row->total) }}
@endforeach
@forelse($top_customers as $row) @empty @endforelse
Customer Orders LTV Avg order Last order
{{ $row->customer?->name ?: '—' }}
{{ $row->customer?->email }}
{{ number_format($row->orders_count) }} {{ $money($row->total_cents) }} {{ $money($row->avg_cents) }} {{ \Illuminate\Support\Carbon::parse($row->last_order_at)->diffForHumans() }} @if($row->customer) Open @endif
No linked customer orders yet.
@endsection