@if($edit) @php $total = 0; $total += $total_edit[$product->id]; $total += $clone_result[$product->id]->first_number ?? 0; @endphp {{ $total }} @else @php $total = 0; $total += $recieved_amount[$product->id] ?? 0; if(!is_null($result)) { $total += $clone_result[$product->id]->last_number ?? 0; } @endphp {{ $total }} @endif