@extends('layouts.finance') @section('title', 'Credit Cards & Debt') @section('subtitle', 'Cards, loans, lines of credit, and debt utilization') @section('content') @php $ccBal = $cards->sum(fn($c) => $metrics->usd($c->payable_balance, $c->currency)); $ccLim = $cards->sum(fn($c) => $metrics->usd($c->credit_limit, $c->currency)); $debtBal = $debts->sum(fn($d) => $metrics->usd($d->outstanding_balance, $d->currency)); $utilization = $ccLim > 0 ? ($ccBal / $ccLim) * 100 : 0; @endphp
Total Debt
{{ $metrics->money($ccBal + $debtBal) }}
Credit Card Balances
{{ $metrics->money($ccBal) }}
Credit Card Limit
{{ $metrics->money($ccLim) }}
Avg. Utilization
{{ number_format($utilization, 1) }}%

Credit Cards

@csrf
@forelse($cards as $card) @php $cardUtil = (float) $card->credit_limit > 0 ? ((float) $card->payable_balance / (float) $card->credit_limit) * 100 : 0; $days = $card->due_date ? now()->startOfDay()->diffInDays($card->due_date->startOfDay(), false) : null; $statusClass = $days === null ? 'pill' : ($days < 0 ? 'pill-red' : ($days <= 7 ? 'pill-amber' : 'pill-green')); $statusText = $days === null ? 'No date' : ($days < 0 ? 'Overdue '.abs((int) $days).'d' : ((int) $days).'d left'); $barColor = $cardUtil > 80 ? '#ef4444' : ($cardUtil > 50 ? '#f59e0b' : '#10b981'); @endphp @csrf @method('PUT') @empty @endforelse
Issuer Card Name Holder Limit Opening Payable Cur. Utilization Due Date
{{ number_format($cardUtil, 0) }}%
{{ $statusText }}
@csrf @method('DELETE')
No credit cards yet · click + Add Card to create one

Other Debts (Loans, Lines of Credit)

@csrf
@forelse($debts as $debt) @csrf @method('PUT') @empty @endforelse
Name Type Lender Outstanding Cur. Interest Rate Monthly Payment
% {{ $metrics->money($debt->monthly_payment, $debt->currency) }}
@csrf @method('DELETE')
No debts yet · click + Add Debt to create one
@endsection