@php $totalCollection = $rows->sum('total_collection'); $totalSettlement = $rows->sum('total_settlement_debit'); $totalPayouts = $rows->sum('total_payouts'); $closingBalance = (float) optional($rows->last())->closing_balance; @endphp