@php $amount = (float) ($data['amount'] ?? 0); $remaining = isset($data['remaining_balance']) ? (float) $data['remaining_balance'] : null; $rows = [ ['label' => 'Receipt #', 'value' => $data['receipt_number'] ?? '-'], ]; if (!empty($data['invoice']['number'])) $rows[] = ['label' => 'Invoice #', 'value' => $data['invoice']['number']]; if (!empty($data['method'])) $rows[] = ['label' => 'Payment Method', 'value' => $data['method']]; $rows[] = ['label' => 'Amount', 'value' => 'CA$' . number_format($amount, 2)]; $rows[] = ['label' => 'Payment Date', 'value' => (string) ($data['payment_date'] ?? '-')]; if ($remaining !== null) $rows[] = ['label' => 'Remaining Balance', 'value' => 'CA$' . number_format($remaining, 2)]; @endphp Hello{{ !empty($data['parent']['name']) ? ' ' . $data['parent']['name'] : '' }}, @include('emails.plain.generic', [ 'heading' => 'Receipt ' . ($data['receipt_number'] ?? ''), 'intro' => 'Thank you — we have received your payment. Your receipt is attached.', 'rows' => $rows, ])