@extends('layouts.dashboard') @section('title', __('Balance')) @section('page_title', __('My Balance')) @php $payoutBadges = ['pending' => 'secondary', 'approved' => 'info', 'paid' => 'success', 'rejected' => 'danger']; $sourceLabels = [ 'refund' => 'Refund', 'purchase' => 'Spent on a purchase', 'withdrawal' => 'Withdrawal', 'withdrawal_reversal' => 'Withdrawal declined', 'adjustment' => 'Adjustment', ]; @endphp @section('content')

{{ __('My Balance') }}

{{ __('Refunded payments land here. Withdraw them to your own account.') }}

{{ __('Total Balance') }}
{{ money($balance) }}
{{ __('Available to withdraw') }}
{{ money($withdrawable) }}
{{ __('On hold') }}
{{ money($held) }}
{{ __('Withdraw') }}
@if(! $withdrawalsEnabled)

{{ __('Withdrawals are currently turned off. Your balance can still be used on the site.') }}

@elseif($withdrawable < $minimum)

{{ __('You need at least :min available to withdraw.', ['min' => money($minimum)]) }} @if($held > 0)
{{ __(':amount is still on hold after a recent refund.', ['amount' => money($held)]) }} @endif

@else
@csrf
{{ __('Up to :max', ['max' => money($withdrawable)]) }}
@endif
@if(module_enabled('gamification') && ($loyaltyRate ?? 0) > 0 && ($loyaltyMin ?? 0) > 0)
{{ __('Redeem points') }}

{{ __(':points points = :cash credit. Minimum :min points.', ['points' => $loyaltyRate, 'cash' => money(1), 'min' => $loyaltyMin]) }} {{ __('You have :have.', ['have' => $loyaltyPoints ?? 0]) }}

@if(($loyaltyPoints ?? 0) >= ($loyaltyMin ?? 0))
@csrf
@else

{{ __('Earn points by completing lessons and courses.') }}

@endif
@endif
{{ __('Withdrawal requests') }}
@forelse($payouts as $payout) @empty @endforelse
{{ __('Date') }}{{ __('Amount') }}{{ __('Status') }}
{{ $payout->created_at->format('d M Y') }} {{ money($payout->amount) }} {{ status_label($payout->status) }}
{{ __('No withdrawal requests yet.') }}
{{ __('Invite friends, earn credit') }}

{{ __('Share your link. When a friend joins, you both earn balance credit.') }} {{ __(':count joined so far — :earned earned.', ['count' => $invitedCount ?? 0, 'earned' => money($inviteEarned ?? 0)]) }}

{{ __('Balance history') }}
@forelse($transactions as $tx) @empty @endforelse
{{ __('Date') }}{{ __('Detail') }}{{ __('Amount') }}
{{ $tx->created_at->format('d M Y') }}
{{ __($sourceLabels[$tx->source] ?? status_label($tx->source)) }}
@if($tx->note)
{{ $tx->note }}
@endif @if($tx->isHeld())
{{ __('On hold until :date', ['date' => $tx->available_at->format('d M Y')]) }}
@endif
{{ $tx->direction === 'credit' ? '+' : '−' }}{{ money($tx->amount) }}
{{ __('Nothing here yet. Refunds you receive will show up on this page.') }}
@endsection