{{-- resources/views/storefront/wallet.blade.php --}} @extends('storefront.layout') @section('title', trans_key('storefront.pageTitles.wallet').' - '.config('app.name', 'FreshMart')) @section('content') @php $balance = (float) ($wallet?->balance ?? 0); $holdBalance = (float) ($wallet?->hold_balance ?? 0); $transactions = $wallet?->transactions ?? collect(); @endphp

Wallet

Use wallet balance during checkout whenever enabled.

Available Balance {{ \App\Support\StorefrontPresenter::money($balance) }} @if($holdBalance > 0)
On hold: {{ \App\Support\StorefrontPresenter::money($holdBalance) }}
@endif

Transactions

@if($transactions->count()) @foreach($transactions as $transaction) @php $isCredit = (float) $transaction->amount >= 0; $amountClass = $isCredit ? 'is-credit' : 'is-debit'; $amountPrefix = $isCredit ? '+' : ''; @endphp
{{ $transaction->description ?: \Illuminate\Support\Str::headline($transaction->type) }}

{{ optional($transaction->created_at)->format('d M Y, h:i A') }}

{{ $amountPrefix }}{{ \App\Support\StorefrontPresenter::money(abs((float) $transaction->amount)) }}
@endforeach @else

No transactions yet

Your wallet history will appear here.

@endif
@endsection