@extends('admin.layouts.app') @section('title', 'Dashboard — ExtraCash Admin') @section('page-title', 'Dashboard') @section('breadcrumb', 'Overview of the platform') @section('content') {{-- Primary KPIs (4) --}}
@php $overviewCards = [ ['label' => 'Total users', 'value' => number_format($stats['users']), 'meta' => 'Registered accounts', '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 0z'], ['label' => 'Payments today', 'value' => 'ZMW ' . number_format($stats['payments_today'], 2), 'meta' => $stats['payments_today_count'] . ' transaction(s)', 'icon' => 'M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z'], ['label' => 'Pending withdrawals', 'value' => number_format($stats['withdrawals_pending']), 'meta' => 'Awaiting review', 'icon' => 'M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z'], ['label' => 'KYC pending', 'value' => number_format($stats['kyc_pending']), 'meta' => 'Awaiting review', 'href' => route('admin.kyc'), 'link' => 'Review', 'icon' => 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'], ]; @endphp @foreach($overviewCards as $s)

{{ $s['label'] }}

{{ $s['value'] }}

{{ $s['meta'] }}

@if(!empty($s['href'] ?? null)) {{ $s['link'] ?? 'Open' }} → @endif
@endforeach
{{-- Secondary quick links: fraud & merchants (compact) --}}
{{ number_format($stats['fraud_open']) }} open fraud flags {{ number_format($stats['merchants_active']) }} active partner merchants Withdrawals Cashback
{{-- Marketplace: two summary cards only --}}

Marketplace

All sellers — completed sales. Split: 2% buyer cashback, 1% admin fee, 97% to sellers.

Gross sales volume

ZMW {{ number_format($stats['marketplace_gross'], 2) }}

  • Today: ZMW {{ number_format($stats['marketplace_gross_today'], 2) }} · {{ number_format($stats['marketplace_sales_today_count']) }} sales
  • {{ number_format($stats['marketplace_sales_count']) }} completed sales · avg order ZMW {{ number_format($stats['marketplace_average_order'], 2) }}
  • {{ number_format($stats['items_sold_total']) }} units sold · {{ number_format($stats['products_total']) }} listings · {{ number_format($stats['stock_units_total']) }} stock (listed)

Fees & payouts (lifetime)

Admin fee (1%)
ZMW {{ number_format($stats['marketplace_admin_fee'], 2) }}

Today: ZMW {{ number_format($stats['marketplace_admin_fee_today'], 2) }}

Marketplace cashback (2%)
ZMW {{ number_format($stats['marketplace_cashback'], 2) }}

Today: ZMW {{ number_format($stats['marketplace_cashback_today'], 2) }}

To sellers (97%)
ZMW {{ number_format($stats['marketplace_seller_net'], 2) }}

Recent marketplace sales

@forelse($recentProductSales as $sale) @empty @endforelse
Product Buyer Seller Gross Admin fee Cashback
{{ $sale->product?->title ?? 'Product deleted' }} {{ $sale->buyer?->name ?? '—' }} {{ $sale->seller?->name ?? '—' }} ZMW {{ number_format($sale->gross_amount, 2) }} ZMW {{ number_format($sale->admin_fee, 2) }} ZMW {{ number_format($sale->cashback_amount, 2) }}
No marketplace sales yet

Top sellers

@forelse($topSellers as $seller)

{{ $seller->seller?->name ?? 'Seller deleted' }}

{{ number_format($seller->sales_count) }} sales

ZMW {{ number_format($seller->gross_total, 2) }}

Seller net: ZMW {{ number_format($seller->seller_net_total, 2) }}

@empty
No seller activity yet
@endforelse
{{-- Recent payments --}}

Recent payments

View all →
@forelse($recentPayments as $p) @empty @endforelse
User Merchant Amount Cashback Status Date
{{ $p->user?->name ?? '—' }} {{ $p->merchant?->name ?? '—' }} ZMW {{ number_format($p->amount, 2) }} ZMW {{ number_format($p->cashback_amount ?? 0, 2) }} {{ $p->status?->value ?? '—' }} {{ $p->created_at->format('M d, H:i') }}
No payments yet
@endsection