@php $editing = isset($invoice) && $invoice; $action = $editing ? route('invoices.update', $invoice) : route('invoices.store'); $method = $editing ? 'PUT' : 'POST'; if ($editing && $invoice->items->isNotEmpty()) { $rows = $invoice->items; } else { $rows = collect([(object) ['description' => '', 'quantity' => 1, 'unit_rate' => '', 'total' => 0]]); } @endphp
@csrf

Line items

@foreach($rows as $idx => $line)
@endforeach

Preview totals (server recalculates on save)

Subtotal: 0.00 · VAT: 0.00 · Total: 0.00