@extends('layouts.app') @section('title', 'Subscriber analytics') @section('content')

Subscriber analytics

{{ $from->format('d M Y') }} – {{ $to->format('d M Y') }}

Export churn CSV
@include('components.kpi', ['label' => 'Active subscribers', 'value' => number_format($summary['active']), 'variant' => 'good', 'href' => '#']) @include('components.kpi', ['label' => 'New this period', 'value' => number_format($summary['new']), 'variant' => 'info', 'href' => '#']) @include('components.kpi', ['label' => 'Churned', 'value' => number_format($summary['churned']), 'variant' => 'bad', 'href' => '#']) @include('components.kpi', ['label' => 'Churn rate', 'value' => percent($summary['churn_rate']), 'variant' => $summary['churn_rate'] < 3 ? 'good' : 'warn', 'href' => '#']) @include('components.kpi', ['label' => 'Net growth', 'value' => number_format($summary['net_growth']), 'variant' => $summary['net_growth'] >= 0 ? 'good' : 'bad', 'href' => '#']) @include('components.kpi', ['label' => 'Suspended', 'value' => number_format($summary['suspended']), 'variant' => 'warn', 'href' => '#'])

Subscriber growth

@include('components.chart', [ 'series' => collect($growth)->map(fn ($g) => [ 'label' => \Carbon\Carbon::parse($g['month'])->format('M y'), 'value' => $g['active'], ])->all(), 'type' => 'line', 'format' => 'number', 'height' => 210, ])

New vs churned

@include('components.chart', [ 'series' => collect($growth)->map(fn ($g) => [ 'label' => \Carbon\Carbon::parse($g['month'])->format('M y'), 'value' => $g['new'], ])->all(), 'type' => 'bar', 'format' => 'number', 'height' => 210, ])

Plan mix

@php $maxSubs = collect($planMix)->max('subscribers') ?: 1; @endphp @forelse ($planMix as $plan)
{{ $plan['plan'] }} {{ $plan['subscribers'] }}
@empty

No active subscriptions.

@endforelse

Churn reasons

@php $maxChurn = collect($churnReasons)->max('total') ?: 1; @endphp @forelse ($churnReasons as $reason)
{{ $reason['reason'] }} {{ $reason['total'] }}
@empty

No churn recorded in this period.

@endforelse

Segment performance

@forelse ($segments as $segment) @empty @endforelse
SegmentSubscribersMRRARPUChurn
{{ title_case_words($segment['segment']) }} {{ number_format($segment['subscribers']) }} {{ money($segment['mrr']) }} {{ money($segment['arpu']) }} {{ percent($segment['churn_rate']) }}
@include('components.empty-state', ['icon' => '👥', 'title' => 'No segment data'])
@endsection