@extends('layouts.app') @section('title', 'My Wallet') @push('styles') @endpush @section('content') @php $totalEarned = $user->transactions()->where('type','earn')->sum('coins'); $totalSpent = $user->transactions()->whereIn('type',['spend','donate'])->sum('coins'); $totalWithdrawn = $user->withdrawals()->where('status','approved')->sum('naira_amount'); $hasPin = (bool) $user->transaction_pin; @endphp {{-- WALLET HERO --}}
Available Balance
{{ number_format($user->getCoins()) }} NC
≈ ₦{{ number_format($user->getNairaValue()) }}  ·  100 NC = ₦1,000
Send My Card @if(!$hasPin) @else @endif
{{ number_format($totalEarned) }}
Total Earned (NC)
{{ number_format($totalSpent) }}
Total Spent (NC)
₦{{ number_format($totalWithdrawn) }}
Total Withdrawn
Min withdrawal: 100 NC  ·  No fees  ·  24hr cooldown  ·  KYC unlocks higher limits
View All Rules
@if(!$hasPin)
Set up a 4-digit transaction PIN to secure your withdrawals and transfers.
@endif {{-- New user restrictions banner --}} @if(isset($accountAgeDays) && $accountAgeDays < 7)
New Account Restrictions
🔒 Withdrawals unlock in {{ 7 - $accountAgeDays }} day(s) (accounts must be 7+ days old)
@if($accountAgeDays < 3)
🔒 Coin transfers unlock in {{ 3 - $accountAgeDays }} day(s) (accounts must be 3+ days old)
@endif
💡 Complete KYC to increase your withdrawal limit to 50,000 NC
@elseif(isset($accountAgeDays) && !$user->isKycApproved())
Verify your identity to unlock higher limits: 50,000 NC withdrawals · 50,000 NC transfers
Submit KYC
@endif
{{-- Withdrawal History --}}
Withdrawal History
{{-- Pending withdrawals --}} @if($pendingWithdrawals->count())
Pending ({{ $pendingWithdrawals->count() }})
@foreach($pendingWithdrawals as $w)
₦{{ number_format($w->naira_amount) }}
{{ $w->bank_name }} · {{ $w->created_at->format('d M Y') }}
Pending
@endforeach
@endif {{-- Limits display --}}
Your Limits
Withdrawal limit{{ number_format($withdrawalLimit) }} NC
Transfer limit{{ number_format($transferLimit) }} NC
Daily transfer remaining{{ number_format($remainingDailyTransfer) }} NC
@if(!$user->isKycApproved())
Submit KYC to increase limits to 50,000 NC
@endif
@forelse($pastWithdrawals->take(6) as $w)
₦{{ number_format($w->naira_amount) }}
{{ $w->bank_name }} · {{ $w->created_at->format('d M Y') }}
{{ ucfirst($w->status) }}
@empty

No withdrawals yet.

@endforelse
{{-- Recent Transactions --}}
Recent Transactions
@forelse($transactions->take(8) as $t) @php $isEarn = $t->type === 'earn'; @endphp
{{ Str::limit($t->description, 40) }}
{{ $t->created_at->diffForHumans() }}
{{ $isEarn ? '+' : '-' }}{{ number_format($t->coins) }} NC
@empty

No transactions yet.

@endforelse
{{-- Full Transaction Table --}}
All Transactions
Export CSV
@forelse($transactions as $t) @php $isEarn = $t->type === 'earn'; @endphp @empty @endforelse
TypeAmountDescriptionStatusDate
{{ str_replace('_',' ',$t->type) }} {{ $isEarn ? '+' : '-' }}{{ number_format($t->coins) }} NC {{ Str::limit($t->description, 50) }} {{ ucfirst($t->status ?? 'completed') }} {{ $t->created_at->format('d M Y, H:i') }}
No transactions yet.
{{ $transactions->links() }}
{{-- FUND WALLET MODAL --}} {{-- WITHDRAW MODAL --}} {{-- SET PIN MODAL — redirect to dedicated page --}} {{-- CHANGE PIN MODAL --}} @push('scripts') @endpush @endsection