{{-- Analytics Section --}}
{{-- Revenue by Payment Gateway --}}
Revenue by Payment Gateway
@if(count($stats['revenue_by_gateway']) > 0)
@foreach($stats['revenue_by_gateway'] as $gateway)
{{ $gateway['gateway'] }}
${{ number_format($gateway['amount'], 2) }} ({{ $gateway['percentage'] }}%)
@endforeach
Total Revenue ${{ number_format($stats['total_revenue_all_time'], 2) }}
@else

No revenue data available yet

@endif
{{-- Platform Distribution --}}
Platform Distribution
@if(count($stats['platform_distribution']) > 0)
@php $colors = [ 'bg-green-600', 'bg-blue-600', 'bg-purple-600', 'bg-orange-600', 'bg-pink-600' ]; @endphp @foreach($stats['platform_distribution'] as $index => $platform)
{{ $platform['platform'] }} {{ $platform['count'] }} ({{ $platform['percentage'] }}%)
@endforeach
Total Apps {{ number_format(array_sum(array_column($stats['platform_distribution'], 'count'))) }}
@else

No apps created yet

@endif
{{-- User Engagement & Additional Metrics --}}
{{-- Total Revenue All Time --}}

Total Revenue

${{ number_format($stats['total_revenue_all_time'], 2) }}
{{-- Pending Payments --}}

Pending Payments

${{ number_format($stats['pending_payments'], 2) }}
{{-- Active Users (Last Week) --}}

Active Users (7d)

{{ number_format($stats['active_users_week']) }}
{{-- Push Notifications Sent Today --}}

Notifications (Today)

{{ number_format($stats['push_notifications_sent_today']) }}
{{-- Build Performance by Platform --}} @if(count($stats['build_performance_by_platform']) > 0)
Build Performance by Platform
@foreach($stats['build_performance_by_platform'] as $platform) @endforeach
Platform Total Builds Completed Failed Success Rate Avg Duration
{{ $platform['platform'] }} {{ number_format($platform['total']) }} {{ number_format($platform['completed']) }} {{ number_format($platform['failed']) }} {{ $platform['success_rate'] }}% @if($platform['avg_duration']) @php $minutes = floor($platform['avg_duration'] / 60); $seconds = $platform['avg_duration'] % 60; @endphp {{ $minutes > 0 ? "{$minutes}m " : '' }}{{ $seconds }}s @else N/A @endif
@endif