{{-- Header Section --}}

Platform Analytics

Comprehensive intelligence and ecosystem growth metrics.

Last 30 Days
{{-- Top Metrics Grid --}}
@php $avgOrder = $totalOrders > 0 ? $totalRevenue / $totalOrders : 0; $metrics = [ ['label' => 'Total Revenue', 'value' => '$' . number_format($totalRevenue, 2), 'color' => 'indigo', 'icon' => 'M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z'], ['label' => 'Total Executions', 'value' => number_format($totalOrders), 'color' => 'emerald', 'icon' => 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2'], ['label' => 'Total Entities', 'value' => number_format($totalCustomers), 'color' => 'blue', 'icon' => 'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z'], ['label' => 'Avg Order Value', 'value' => '$' . number_format($avgOrder, 2), 'color' => 'purple', 'icon' => 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6'], ]; @endphp @foreach ($metrics as $metric)

{{ $metric['label'] }}

{{ $metric['value'] }}

@endforeach
{{-- Sales Trajectory Chart --}}

Revenue Trajectory

Aggregated platform revenue across the last 30 execution cycles.

@php $maxVal = count($salesTrajectory) > 0 ? max(array_values($salesTrajectory->toArray())) : 1; @endphp @foreach ($salesTrajectory as $date => $amount) @php $height = ($amount / $maxVal) * 100; @endphp
${{ number_format($amount) }}
{{-- Show labels only for some points to avoid clutter --}} @if($loop->iteration % 5 == 0 || $loop->first || $loop->last) {{ \Carbon\Carbon::parse($date)->format('M d') }} @endif
@endforeach @if(count($salesTrajectory) == 0)
Telemetery stream offline. No data found.
@endif
Revenue Stream
{{-- Top Performing Assets --}}

Top Performing Assets

High-velocity products ranked by order frequency.

@forelse ($topProducts as $product)
@if($product->thumbnail) @else @endif

{{ $product->name }}

{{ $product->sales_count }} Executions

${{ number_format($product->price, 2) }}

@empty
Awaiting asset deployment.
@endforelse
{{-- Protocol Status Distribution --}}

Protocol Status Distribution

Categorical breakdown of order lifecycle states.

@php $totalDist = array_sum($orderDistribution->toArray()); $colors = ['paid' => 'emerald', 'pending' => 'amber', 'failed' => 'rose', 'cancelled' => 'neutral']; $segments = []; $currentDeg = 0; foreach($orderDistribution as $status => $count) { $deg = ($count / max(1, $totalDist)) * 360; $color = $colors[$status] ?? 'indigo'; $segments[] = "var(--{$color}-500) {$currentDeg}deg " . ($currentDeg + $deg) . "deg"; $currentDeg += $deg; } $conic = count($segments) > 0 ? implode(', ', $segments) : 'rgba(255,255,255,0.05) 0deg 360deg'; @endphp

Total

{{ $totalDist }}

@foreach ($orderDistribution as $status => $count) @php $color = $colors[$status] ?? 'indigo'; @endphp

{{ $status }}

{{ number_format(($count / max(1, $totalDist)) * 100, 1) }}%

@endforeach
{{-- Customer Growth --}}

Entity Growth (Customers)

Monthly registration velocity of unique platform participants.

@php $maxGrowth = $userGrowth->max('count') ?: 1; @endphp @foreach ($userGrowth as $growth)
{{ $growth->count }} New
{{ \Carbon\Carbon::parse($growth->month . '-01')->format('M Y') }}
@endforeach