@php
$staff = auth('staff')->user();
$wallet = $user->wallet;
$balances = [
['label' => 'Total balance', 'value' => $wallet?->totalBalance() ?? '0.00', 'hint' => 'Deposit + eligible winnings'],
['label' => 'Deposit balance', 'value' => $wallet?->deposit_balance ?? '0.00', 'hint' => 'Spent on entry fees first'],
['label' => 'Eligible winnings', 'value' => $wallet?->eligible_winnings_balance ?? '0.00', 'hint' => 'Can be withdrawn'],
];
@endphp
@if ($user->is_banned)
@else
@endif
@if ($staff->hasPermission('users.ban'))
{{ $user->is_banned ? 'Unban account' : 'Ban account' }}
@endif
@foreach ($balances as $balance)
{{ $balance['label'] }}
{{ $balance['value'] }}
{{ $balance['hint'] }}
@endforeach
{{-- Read-only history --}}
| When |
Type |
Balance |
Amount |
Reason |
@forelse ($ledgerEntries as $entry)
@php($credit = $entry->isCredit())
| {{ $entry->created_at->format('d M, H:i') }} |
{{ ucfirst(str_replace('_', ' ', $entry->type)) }} |
{{ ucfirst($entry->balance) }} |
$credit, 'text-danger' => ! $credit])>
{{ $credit ? '+' : '' }}{{ $entry->amount }}
|
@if ($entry->reason)
{{ $entry->reason }}
@else
—
@endif
|
@empty
@endforelse
| Tournament |
Status |
Entry fee paid |
Joined |
@forelse ($tournamentEntries as $entry)
|
@if ($staff->hasPermission('tournaments.view'))
{{ $entry->tournament->title }}
@else
{{ $entry->tournament->title }}
@endif
|
|
{{ $entry->entry_fee_paid }}
|
{{ $entry->created_at->format('d M, H:i') }} |
@empty
@endforelse
{{-- Modifying: kept apart from the read-only history above --}}
@if ($staff->hasPermission('wallet.manage'))
@endif