@extends('layouts.admin') @section('title', 'Admin Dashboard') @section('page-title', 'Dashboard') @section('content') {{-- Page Header --}}

@yield('page-title', 'Dashboard')

Overview of your platform

{{-- ═══ TOP STAT CARDS ═══ --}}
{{-- Card 1: Total Users --}}
Total Users
{{ number_format($stats['total_users']) }}
@if($trends['users_change'] >= 0) {{ $trends['users_change'] }}% @else {{ abs($trends['users_change']) }}% @endif from last week
{{-- Card 2: Today's Revenue --}}
Today's Revenue
@money($stats['today_earnings'])
@if($trends['today_vs_yesterday'] >= 0) {{ $trends['today_vs_yesterday'] }}% @else {{ abs($trends['today_vs_yesterday']) }}% @endif from yesterday
{{-- Card 3: Total Revenue --}}
Total Revenue
@money($stats['total_earnings'])
@if($trends['revenue_change'] >= 0) {{ $trends['revenue_change'] }}% @else {{ abs($trends['revenue_change']) }}% @endif from last month
{{-- Card 4: Pending Cashouts --}}
Pending Cashouts
{{ $stats['pending_withdrawals_count'] }}
@money($stats['pending_withdrawals_amount']) pending
{{-- Card 5: Total Cashed Out --}}
Total Cashed Out
@money($stats['total_withdrawn'])
@money($stats['total_paid']) paid to users
{{-- ═══ MIDDLE ROW (CHARTS & RECENT CASHOUTS) ═══ --}}
{{-- Revenue Overview Chart --}}

Revenue Overview

@php $totalChartRevenue = collect($revenueChart)->sum('revenue'); @endphp @money($totalChartRevenue) @if($trends['revenue_change'] >= 0) {{ $trends['revenue_change'] }}% vs previous @else {{ abs($trends['revenue_change']) }}% vs previous @endif
{{ $startDate->format('M j, Y') }} — {{ $endDate->format('M j, Y') }}
{{-- Revenue by Source (Doughnut) --}}

Revenue by Source

Total @money($stats['total_earnings'])
@php $sourceColors = ['#00f260', '#8b5cf6', '#3b82f6', '#14b8a6', '#f59e0b', '#ef4444', '#ec4899', '#6366f1', '#06b6d4', '#84cc16']; $totalRevAll = $providerRev->sum('total_rev') ?: 1; @endphp
@foreach($providerRev->take(5) as $idx => $source) @php $srcPct = round(($source->total_rev / $totalRevAll) * 100, 1); @endphp
{{ $source->network_slug }}
{{ $srcPct }}%
@endforeach @if($providerRev->isEmpty())
No revenue data yet
@endif
{{-- Recent Cashouts --}}

Recent Cashouts

View All
@foreach($recentWithdrawals->take(5) as $w) @endforeach @if($recentWithdrawals->isEmpty()) @endif
User Method Amount Status
{{ $w->user->username ?? 'Unknown' }} @if(strtolower($w->method) === 'paypal') @elseif(strtolower($w->method) === 'usdt') @else @endif {{ $w->method }} @money($w->amount) @if($w->status === 'pending') Pending @elseif($w->status === 'completed') Completed @else Rejected @endif
No recent cashouts.
{{-- ═══ BOTTOM ROW (ACTIVITY, OFFERWALLS, GEO) ═══ --}}
{{-- Recent Activity (REAL DATA) --}}

Recent Activity

View All
@forelse($activityTimeline as $activity)
{{ $activity['text'] }}
{{ $activity['time']->diffForHumans() }}
@empty
No recent activity
@endforelse
{{-- Top Offerwalls --}}

Top Offerwalls

View All
@if($providerRev->isEmpty()) @else @foreach($providerRev->take(5) as $prov) @endforeach @endif
Offerwall Revenue Conversions Paid Out
No data yet.
{{ $prov->network_slug }}
@money($prov->total_rev) {{ number_format($prov->total_conversions) }} @money($prov->total_paid)
{{-- Top Countries with SVG Map --}}

Top Countries

{{-- SVG World Map --}}
@php $totalGeoUsers = $geoStats->sum('users_count') ?: 1; $countryNames = [ 'US' => 'United States', 'IN' => 'India', 'BR' => 'Brazil', 'PH' => 'Philippines', 'GB' => 'United Kingdom', 'DE' => 'Germany', 'CA' => 'Canada', 'AU' => 'Australia', 'FR' => 'France', 'ID' => 'Indonesia', 'MX' => 'Mexico', 'VN' => 'Vietnam', 'NG' => 'Nigeria', 'PK' => 'Pakistan', 'BD' => 'Bangladesh', 'JP' => 'Japan', 'KR' => 'South Korea', 'IT' => 'Italy', 'ES' => 'Spain', 'TR' => 'Turkey', ]; @endphp @foreach($geoStats->take(5) as $idx => $geo) @php $code = strtoupper($geo->country); $name = $countryNames[$code] ?? $code; $pct = round(($geo->users_count / $totalGeoUsers) * 100, 1); @endphp
{{ $idx + 1 }} {{ $name }}
{{ $pct }}%
@endforeach @if($geoStats->isEmpty())
No geo data available
@endif
{{-- ═══ SYSTEM OVERVIEW (PILLS) ═══ --}}

System Overview

View Details
Active Users
{{ number_format($stats['active_users']) }}
New Today
{{ number_format($trends['today_signups']) }}
Today Paid
@money($stats['today_paid'])
Pending $
@money($stats['pending_withdrawals_amount'])
Providers
{{ $providerRev->count() }}
@endsection @push('styles') {{-- jsvectormap CSS is bundled via Vite (resources/js/admin.js) --}} @endpush @push('scripts') @include('partials.flatpickr') {{-- Chart.js + jsvectormap (+ world map) are bundled via Vite in resources/js/admin.js --}} @endpush