@extends('layouts.app') @section('title', __('Wallet Management - Admin')) @php /* * All wallet values displayed by this administrative view follow the * administrator-selected currency in Payment Settings. */ $displayCurrency = default_currency(); /* * Build the wallet ID sorting URL locally. The general sortable_url() * helper in this project currently targets the admin users route. */ $currentSort = (string) request('sort', 'id'); $currentDirection = strtolower( (string) request('direction', 'desc') ); $idSortDirection = $currentSort === 'id' && $currentDirection === 'asc' ? 'desc' : 'asc'; $idSortUrl = route( 'admin.wallet.index', array_merge( request()->except(['sort', 'direction', 'page']), [ 'sort' => 'id', 'direction' => $idSortDirection, ] ) ); @endphp @section('content')
{{-- Page Header --}}

Wallet Management

Monitor and manage all wallet transactions across the platform

Export
{{-- Quick Stats --}} @include('admin.wallet.partials.stats', [ 'stats' => $stats, 'displayCurrency' => $displayCurrency, ]) {{-- Filters --}}
{{-- Search --}}
{{-- Entry Type --}}
{{-- Source Type --}}
{{-- Currency --}}
{{-- Per Page --}}
{{-- Hidden sort/direction --}} {{-- Reset --}}
Reset
{{ $entries->total() }} entries found @if($entries->total() > 0) ({{ $entries->firstItem() }} - {{ $entries->lastItem() }}) @endif
{{-- Currency Summary --}} @if(collect($amountsByCurrency ?? [])->isNotEmpty())
{{ __('Currency Summary') }}
@foreach($amountsByCurrency as $currencyData) @php $credits = (float) data_get( $currencyData, 'credits', 0 ); $debits = (float) data_get( $currencyData, 'debits', 0 ); $net = (float) data_get( $currencyData, 'net', $credits - $debits ); @endphp
{{ __('Currency') }} {{ $displayCurrency }}
{{-- Total Credits --}}
{{ __('Credits') }}
+{{ money(abs($credits), $displayCurrency) }}
{{-- Total Debits --}}
{{ __('Debits') }}
-{{ money(abs($debits), $displayCurrency) }}
{{-- Net Balance --}}
{{ __('Net Balance') }}
{{ $net < 0 ? '-' : '' }}{{ money(abs($net), $displayCurrency) }}
@endforeach
@endif {{-- Ledger Entries Table --}}
@forelse($entries as $entry) @php $entryType = strtolower( (string) ($entry->entry_type ?? 'unknown') ); $isCredit = $entryType === 'credit'; $entryAmount = abs( (float) ($entry->amount ?? 0) ); $entryCreatedAt = null; if (filled($entry->created_at)) { try { $entryCreatedAt = \Illuminate\Support\Carbon::parse( $entry->created_at ); } catch (\Throwable) { $entryCreatedAt = null; } } $adjustmentReason = data_get( $entry->metadata, 'reason' ); @endphp @empty @endforelse
ID User Type Source Reference Amount Balance After Currency Date Actions
#{{ $entry->id }}
{{ $entry->user?->username ?? 'Unknown' }}
{{ $entry->user?->email ?? '' }}
{{ \Illuminate\Support\Str::headline($entryType) }} {{ \Illuminate\Support\Str::headline($entry->source_type ?? 'unknown') }} {{ \Illuminate\Support\Str::limit($entry->source_reference ?? 'N/A', 25) }} {{ $isCredit ? '+' : '-' }}{{ money($entryAmount, $displayCurrency) }} {{ money($entry->balance_after ?? 0, $displayCurrency) }} {{ $displayCurrency }}
@if($entryCreatedAt)
{{ $entryCreatedAt->format('M d, Y') }}
{{ $entryCreatedAt->diffForHumans() }}
@else
{{ __('N/A') }}
@endif
@if($entry->user) @endif @if(filled($adjustmentReason)) @endif
No wallet entries found

Try adjusting your search or filter criteria

{{-- Pagination --}} @if($entries->hasPages()) @endif
{{-- Reason Modal --}} @endsection @push('styles') @endpush @push('scripts') @endpush