@extends('admin.layouts.app') @section('title', 'User Detail — ExtraCash Admin') @section('page-title', 'User Detail') @section('breadcrumb', 'Account overview') @section('content') @php $latestKyc = $user->kycRecords->first(); $badgeClass = function (?string $status) { return match ($status) { 'verified', 'successful' => 'verified', 'pending', 'processing', 'requested', 'under_review', 'locked' => 'pending', 'approved', 'paid', 'available' => 'approved', 'rejected', 'failed', 'reversed', 'cancelled', 'expired', 'not_submitted' => 'rejected', default => 'pending', }; }; $labelize = fn (?string $s) => $s ? ucwords(str_replace('_', ' ', $s)) : '—'; @endphp
← Back to users User ID: {{ $user->id }}

Wallet Total

ZMW {{ number_format(($user->wallet?->available_balance ?? 0) + ($user->wallet?->pending_balance ?? 0), 2) }}

Payments

{{ number_format($stats['payments_count']) }}

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

Withdrawals

{{ number_format($stats['withdrawals_count']) }}

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

Cashback Earned

{{ number_format($stats['cashbacks_count']) }}

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

{{-- Profile + wallet tools --}}
{{ strtoupper(substr($user->name, 0, 2)) }}

{{ $user->name }}

{{ $user->email }}

Joined
{{ $user->created_at->format('M d, Y H:i') }}
KYC Status
{{ $labelize($latestKyc?->status?->value) }}
Account Status
@if($user->suspended_at) Suspended @else Active @endif
Available Balance
ZMW {{ number_format($user->wallet?->available_balance ?? 0, 2) }}
Pending Balance
ZMW {{ number_format($user->wallet?->pending_balance ?? 0, 2) }}
Lifetime Cashback
ZMW {{ number_format($user->wallet?->lifetime_cashback_earned ?? 0, 2) }}

Account actions

@if($user->suspended_at)
Suspended {{ $user->suspended_at?->format('M d, Y H:i') }} by {{ $user->suspendedBy?->name ?? '—' }}.
@if($user->suspension_reason)
Reason: {{ $user->suspension_reason }}
@endif
@csrf
@else
@csrf
@error('reason')

{{ $message }}

@enderror
@endif
@csrf
@csrf
@csrf
@if(session('temp_password'))

Temporary password (copy now):

{{ session('temp_password') }}

@endif

Edit profile

@csrf
@error('name')

{{ $message }}

@enderror
@error('email')

{{ $message }}

@enderror
@error('phone_number')

{{ $message }}

@enderror
phone_verified_at ? 1 : 0) ? 'checked' : '' }} />
@error('nrc_number')

{{ $message }}

@enderror
@error('tpin')

{{ $message }}

@enderror

Internal notes

@csrf @error('note')

{{ $message }}

@enderror
@forelse($user->adminNotes ?? [] as $n)

{{ $n->admin?->name ?? 'Admin' }}

{{ $n->created_at?->format('M d, Y H:i') }}

{{ $n->note }}

@empty

No notes yet

@endforelse
@can('users.assign_roles')

Roles

{{ $user->roles->pluck('name')->implode(', ') ?: 'No roles' }}
@csrf
@error('roles')

{{ $message }}

@enderror @error('roles.*')

{{ $message }}

@enderror

Hold Ctrl/Command to select multiple roles.

@endcan

Manual Wallet Funding

@csrf
@error('amount')

{{ $message }}

@enderror
@error('narration')

{{ $message }}

@enderror

KYC History

@forelse($user->kycRecords->take(8) as $k)

{{ strtoupper($k->id_type ?? 'ID') }} · {{ $k->id_number ?? '—' }}

{{ $labelize($k->status?->value) }}

Submitted {{ $k->created_at?->format('M d, Y H:i') ?? '—' }}

@if($k->review_notes)

{{ $k->review_notes }}

@endif
@empty

No KYC records

@endforelse
{{-- Activity tables --}}

Recent Payments

@forelse($user->payments as $p) @empty @endforelse
Reference Amount Status Date
{{ $p->payment_reference ?? ('#'.$p->id) }} ZMW {{ number_format($p->amount, 2) }} {{ $labelize($p->status?->value) }} {{ $p->created_at?->format('M d, Y H:i') ?? '—' }}
No payments

Withdrawals

@forelse($user->withdrawals as $w)

{{ $w->reference ?? ('Withdrawal #'.$w->id) }}

{{ $w->created_at?->format('M d, Y H:i') ?? '—' }}

ZMW {{ number_format($w->amount, 2) }}

{{ $labelize($w->status?->value) }}
@empty

No withdrawals

@endforelse

Cashback Transactions

@forelse($user->cashbackTransactions as $cb)

Payment: {{ $cb->payment?->payment_reference ?? ('#'.$cb->payment_id) }}

Rate {{ number_format(((float)$cb->cashback_rate) * 100, 2) }}% • {{ $cb->created_at?->format('M d, Y H:i') }}

ZMW {{ number_format($cb->cashback_amount, 2) }}

{{ $labelize($cb->status?->value) }}
@empty

No cashback transactions

@endforelse

Recent Wallet Transactions

@forelse($user->wallet?->transactions ?? [] as $t) @empty @endforelse
Narration Type Amount Date
{{ $t->narration }} {{ ucfirst($t->type) }} {{ $t->type === 'credit' ? '+' : '-' }}ZMW {{ number_format($t->amount, 2) }} {{ $t->transacted_at?->format('M d, Y H:i') ?? '—' }}
No wallet transactions
@endsection