@extends('layouts.admin') @section('title', 'Dashboard') @section('page-title', 'Operations Dashboard') @section('content') @php $kpis = [ ['label' => 'Total Users', 'value' => number_format($stats['total_users'] ?? 0), 'tone' => 'red'], ['label' => 'Active 30 Days', 'value' => number_format($stats['active_users_30d'] ?? 0), 'tone' => 'green'], ['label' => 'Paid Users', 'value' => number_format($stats['paid_users'] ?? 0), 'tone' => 'red'], ['label' => 'Active Subs', 'value' => number_format($stats['active_subscriptions'] ?? 0), 'tone' => 'green'], ['label' => 'Syncs Today', 'value' => number_format($stats['syncs_today'] ?? 0), 'tone' => 'red'], ['label' => 'Storage Used', 'value' => number_format($stats['storage_gb'] ?? 0, 2) . ' GB', 'tone' => 'green'], ]; $maxPlan = max($planDistribution->max() ?? 1, 1); $maxSync = max($syncsByDay->max() ?? 1, 1); @endphp
@foreach($kpis as $kpi)

{{ $kpi['label'] }}

{{ $kpi['value'] }}

@endforeach

Sync Activity

Last 30 days of uploads and downloads recorded by the API.

30-day window
@forelse($syncsByDay as $date => $count)

{{ $count }}

{{ \Illuminate\Support\Carbon::parse($date)->format('d M') }}

@empty
No sync logs available yet.
@endforelse

Plan Distribution

Current user plan mix excluding admin accounts.

@forelse($planDistribution as $plan => $count)
{{ ucfirst($plan) }} {{ number_format($count) }}
@empty

No plan data available.

@endforelse

Recent Users

View all
@forelse($recentUsers as $user) @empty @endforelse
User Plan Joined Last Seen
{{ $user->name }}
{{ $user->email }}
{{ ucfirst($user->currentPlan()) }} {{ $user->created_at?->format('d M Y') }} {{ $user->last_seen_at?->diffForHumans() ?? 'Never' }}
No users found.

Recent Sync Logs

View all
@forelse($recentSyncs as $log)

{{ $log->user->name ?? 'Unknown' }}

{{ $log->user->email ?? '' }}

{{ strtoupper($log->direction) }} • {{ $log->table_name }} • {{ $log->records_count }} records

{{ ucfirst($log->status) }}

{{ $log->created_at?->diffForHumans() }}

@empty
No recent sync logs found.
@endforelse
@endsection