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

Line items

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

Preview total (server recalculates on save)

Total: 0.00 MWK