@php $i = 1 @endphp @foreach ($applications as $app) @php $banakhats = $app->NewBanakhatPayment; $saledeeds = $app->NewSaledeedPayment; $payments = $app->payments; $totalPayments = $payments->sum('amount'); // Sum of all payments $maxRows = max($banakhats->count(), $saledeeds->count(), 1); // Removed payments->count() since we now show total @endphp @for ($i = 0; $i < $maxRows; $i++) {{-- Register No - show only on first row --}} {{-- Banakhat --}} {{-- Saledeed --}} {{-- Mortgage, Construction, Extra Construction --}} {{-- Total Payment --}} {{-- Created At --}} @endfor @endforeach
Registration No. Bana Amount Bana Chq. Sale Deed Amount Sale Deed Chq. Construction Amount Extra - Construction Mortgage Registration Fee Registration Date
{{ $i == 0 ? $app->register_no : '' }} {{ $banakhats[$i]->banakhat_amount ?? '-' }} {{ $banakhats[$i]->banakhat_cheque_upi_no ?? '-' }} {{ $saledeeds[$i]->saledeed_amount ?? '-' }} {{ $saledeeds[$i]->saledeed_cheque_upi_no ?? '-' }} {{ $i == 0 ? ($app->mortgage_amount_number ?? '-') : '' }} {{ $i == 0 ? ($app->construction_amount ?? '-') : '' }} {{ $i == 0 ? ($app->extra_construction_amount ?? '-') : '' }} {{ $i == 0 ? $totalPayments : '' }} {{ $i == 0 ? ($app->created_at ?? '-') : '' }}