@php $statusAlerts = [ \App\Enums\AgentStatus::APPROVED->value => [ 'class' => 'success', 'icon' => 'fa-circle-check', 'text' => __('This agent is approved and can process cash operations.'), ], \App\Enums\AgentStatus::DISABLED->value => [ 'class' => 'warning', 'icon' => 'fa-triangle-exclamation', 'text' => __('This agent is disabled. Enable it before allowing new operations.'), ], \App\Enums\AgentStatus::PENDING->value => [ 'class' => 'info', 'icon' => 'fa-hourglass-half', 'text' => __('Review the profile, select commission rules, then approve when ready.'), ], \App\Enums\AgentStatus::REJECTED->value => [ 'class' => 'danger', 'icon' => 'fa-circle-xmark', 'text' => __('This agent request has been rejected.'), ], ]; $alert = $statusAlerts[$agent->status->value] ?? $statusAlerts[\App\Enums\AgentStatus::PENDING->value]; $assignedRules = $agent->commissionRuleAssignments->keyBy('agent_commission_rule_id'); $availableRules = $commissionRules ?? collect(); $operationOptions = ['all' => __('All Operations')] + \App\Enums\AgentOperationType::options(); $description = trim((string) ($agent->description ?? '')); $supportedCurrencyCodes = $agent->supportedCurrencies->pluck('code')->implode(', ') ?: $agent->currency?->code; @endphp