@php // Tiny inline sparkline for the KPI cards. $spark = function (array $pts, string $color) { $max = max($pts) ?: 1; $min = min($pts); $w = 100; $h = 30; $n = count($pts); $coords = []; foreach ($pts as $i => $v) { $x = $n <= 1 ? 0 : $i / ($n - 1) * $w; $y = $h - ($max == $min ? 0.5 : ($v - $min) / ($max - $min)) * ($h - 4) - 2; $coords[] = round($x, 1).','.round($y, 1); } return ''; }; $kpiCards = [ ['icon' => 'users', 'tint' => '#7c3aed', 'label' => 'Total Users', 'value' => number_format($kpis['total_users']), 'delta' => 12.4, 'up' => true, 'spark' => [4,6,5,7,8,7,9]], ['icon' => 'crown', 'tint' => '#f59e0b', 'label' => 'Active Subscriptions', 'value' => number_format($kpis['active_subscriptions']), 'delta' => 9.8, 'up' => true, 'spark' => [3,4,4,5,6,7,8]], ['icon' => 'dollar-sign', 'tint' => '#22c55e', 'label' => 'Total Revenue', 'value' => '$'.number_format($kpis['mrr']), 'delta' => 18.2, 'up' => true, 'spark' => [5,6,6,8,7,9,11]], ['icon' => 'send', 'tint' => '#3b82f6', 'label' => 'Total Posts Today', 'value' => number_format($kpis['posts_today']), 'delta' => 24.6, 'up' => true, 'spark' => [6,7,8,7,9,10,12], 'sub' => 'vs yesterday'], ['icon' => 'layers', 'tint' => '#8b5cf6', 'label' => 'Platform Accounts', 'value' => number_format($kpis['connected_accounts']), 'delta' => 16.8, 'up' => true, 'spark' => [4,5,6,6,7,8,9]], ['icon' => 'shield-check', 'tint' => '#22c55e', 'label' => 'System Uptime', 'value' => $kpis['uptime'].'%', 'delta' => null, 'up' => true, 'spark' => [9,9,10,9,10,10,10], 'ok' => 'Operational'], ]; $donutTotal = collect($plans)->sum('count'); $statusColor = ['active' => 'text-green-400', 'suspended' => 'text-red-400', 'pending' => 'text-amber-400']; $planBadge = ['Pro' => 'text-amber-400 bg-amber-500/10', 'Business' => 'text-blue-400 bg-blue-500/10', 'Agency' => 'text-pink-400 bg-pink-500/10', 'Free' => 'text-slate-400 bg-slate-500/10']; @endphp
Complete overview of your CC Publisher SaaS platform
| User | Plan | Accounts | Posts Today | Status | Joined |
|---|---|---|---|---|---|
|
{{ strtoupper(substr($u['name'] ?: $u['email'], 0, 1)) }}
{{ $u['name'] }}
{{ $u['email'] }}
|
{{ $u['plan'] }} | {{ $u['accounts'] }} | {{ number_format($u['posts_today']) }} | {{ ucfirst($u['status']) }} | {{ $u['joined'] }} |
| No users yet. | |||||