@php
$formId = $formId ?? 'agent_operation';
$requiresCustomerOtp = $requiresCustomerOtp ?? false;
$agentOptions = collect($agents);
$singleAgent = $agentOptions->count() === 1 ? $agentOptions->first() : null;
$walletOptions = collect($wallets);
if ($singleAgent) {
$singleAgent->loadMissing('supportedCurrencies');
$supportedCurrencyIds = $singleAgent->supportedCurrencyIds();
$walletOptions = $walletOptions
->whereIn('currency_id', $supportedCurrencyIds)
->values();
}
@endphp
@if($singleAgent)
{{ $singleAgent->agent_name }}
{{ $singleAgent->agent_code }}
·
{{ $singleAgent->supportedCurrencies->pluck('code')->implode(', ') ?: $singleAgent->currency?->code }}
·
{{ number_format((float) $singleAgent->commission, 2) }}%
@else
@error('agent_id')
{{ $message }}
@enderror
@endif
@error('wallet_id')
{{ $message }}
@enderror
@if($walletOptions->isEmpty())
{{ __('No active wallet matches this agent account currencies.') }}
@endif
@error('customer')
{{ $message }}
@enderror
@error('amount')
{{ $message }}
@enderror
@error('note')
{{ $message }}
@enderror
@if($requiresCustomerOtp)
{{ __('Send an OTP to the customer first, then enter that code here to complete cash-out.') }}
@error('customer_otp')
{{ $message }}
@enderror
@endif