@extends('layouts.app') @section('title', 'Currencies') @section('breadcrumb') @endsection @section('content')
{{-- Currency List --}}
{{-- Base Currency Info --}} @php $base = $currencies->firstWhere('is_base', true); @endphp @if($base)
Base Currency: {{ $base->code }} ({{ $base->name }}) — {{ $base->symbol }}
@endif
All Currencies
@forelse($currencies as $currency) @empty @endforelse
Code Name Symbol Dec. Type Status Actions
{{ $currency->code }} {{ $currency->name }} {{ $currency->symbol }} {{ $currency->decimal_places }} @if($currency->is_base) Base @else Foreign @endif {{ $currency->is_active ? 'Active' : 'Inactive' }} @if(!$currency->is_base && auth()->user()->hasPermission('settings','edit'))
@csrf @method('DELETE')
@endif
No currencies added yet.
{{-- Exchange Rates (N+1 fixed — rates pre-loaded from controller) --}} @foreach($currencies->where('is_base', false) as $currency) @php $rates = $allRates->get($currency->id, collect())->take(5); @endphp
{{ $currency->code }} — Exchange Rates {{ $currency->symbol }}
@if(auth()->user()->hasPermission('settings','edit'))
@csrf @method('PUT')
@endif @if($rates->count() > 0) @foreach($rates as $rate) @endforeach
DateRate
{{ $rate->rate_date->format('d M Y') }} {{ number_format($rate->rate, 6) }}
@else

No rates set yet. Add the first rate above.

@endif
@endforeach
{{-- Add Currency + Reference --}}
@if(auth()->user()->hasPermission('settings','edit'))
Add Currency
@csrf
@error('code')
{{ $message }}
@enderror
@error('symbol')
{{ $message }}
@enderror
@error('name')
{{ $message }}
@enderror
@endif
Common Currencies
@foreach([['USD','$','US Dollar'],['EUR','€','Euro'],['GBP','£','British Pound'],['BDT','৳','Bangladeshi Taka'],['AED','د.إ','UAE Dirham'],['SAR','﷼','Saudi Riyal'],['INR','₹','Indian Rupee'],['JPY','¥','Japanese Yen'],['CNY','¥','Chinese Yuan'],['CAD','$','Canadian Dollar'],['AUD','$','Australian Dollar'],['SGD','$','Singapore Dollar']] as [$code,$sym,$name]) @endforeach
CodeSymbolName
{{ $code }} {{ $sym }} {{ $name }}
{{-- Edit Modal --}} @endsection @push('scripts') @endpush