@php use App\Constants\CurrencyRole; $totalCurrencies = $currencies->count(); $activeCurrencies = $currencies->where('status', true)->count(); $inactiveCurrencies = max(0, $totalCurrencies - $activeCurrencies); $liveRateCurrencies = $currencies->where('rate_live', true)->count(); $fiatCurrencies = $currencies->where('type', 'fiat')->count(); $cryptoCurrencies = $currencies->where('type', 'crypto')->count(); $defaultCurrency = $currencies->firstWhere('default', true); $activePercent = $totalCurrencies > 0 ? round(($activeCurrencies / $totalCurrencies) * 100) : 0; @endphp @extends('backend.layouts.app') @section('title', __('Currencies')) @push('styles') @endpush @section('content')
{{ __('Treasury Console') }}

{{ __('Currency Management') }}

{{ __('Operate fiat, crypto, live exchange feeds, wallet defaults, and transaction role policies from a bank-grade control surface.') }}

{{ $activePercent }}% {{ __('active coverage') }} · {{ __(':count inactive', ['count' => $inactiveCurrencies]) }}
{{ __('Base Currency') }} {{ siteCurrency() }} {{ $defaultCurrency?->name ?? __('No default currency selected') }}
{{ __('Total Currencies') }} {{ number_format($totalCurrencies) }}
{{ __('Active') }} {{ number_format($activeCurrencies) }} {{ $activePercent }}% {{ __('of network') }}
{{ __('Live Feeds') }} {{ number_format($liveRateCurrencies) }}
{{ __('Fiat / Crypto') }} {{ $fiatCurrencies }} / {{ $cryptoCurrencies }}
@if (session('exchange_rate_error'))
{{ __('Exchange rate sync issue') }}

{{ session('exchange_rate_error') }}

@endif
{{ __('Currency Ledger') }}
{{ __('Supported Currency Network') }}

{{ __('Review conversion source, role access, and operational state for every wallet currency.') }}

{{ __('Base:') }} {{ siteCurrency() }} {{ __('Records:') }} {{ $totalCurrencies }}
@forelse($currencies as $currency) $currency->default]) data-search="{{ strtolower($currency->name.' '.$currency->code.' '.$currency->symbol.' '.$currency->type) }}" data-type="{{ strtolower($currency->type) }}" data-status="{{ $currency->status ? 'active' : 'inactive' }}" data-live="{{ $currency->rate_live ? 'live' : 'manual' }}"> @empty @endforelse
{{ __('Currency') }} {{ __('Exchange') }} {{ __('Role Access') }} {{ __('Operational State') }} {{ __('Actions') }}
@if($currency->flag) {{ $currency->name }} @endif @if($currency->default) @endif
{{ $currency->name }}
{{ $currency->code }} · {{ $currency->symbol }}
{{ $currency->type }} @if($currency->rate_live) {{ __('Live') }} @else {{ __('Manual') }} @endif
1 {{ siteCurrency() }} {{ number_format($currency->getRawOriginal('exchange_rate'), (int) setting('site_decimal', 2), '.', '') }} {{ $currency->code }}
@forelse($currency->activeRoles as $role) {{ strtoupper($role->role_name) }} @empty {{ __('No active role') }} @endforelse
{{ $currency->status ? __('Activated') : __('Not Activated') }} {{ $currency->auto_wallet ? __('Auto wallet enabled') : __('Manual wallet creation') }}
@if($currency->default != 1) @endif
{{ __('No matching currencies') }} {{ __('Try a different search or filter.') }}
@include('backend.currencies.partials._create_modal') @include('backend.currencies.partials._edit_modal') @include('backend.currencies.partials._default_change_modal') @endsection @push('scripts') {{-- When the create form fails server-side validation, Laravel redirects back with $errors + flashed input. The modal would normally be closed (page reloaded), so the admin saw an empty index and assumed nothing happened. Detect the flashed input that only the create form sends (`_currency_form = create`) and auto-reopen the modal so the field-level errors are visible in context. --}} @if($errors->any() && old('_currency_form') === 'create') @endif @endpush