My Orders

@if(count($orders) == 0)

Orders in progress

car surrounded by various sizes of plus signs

Here you will see cars in transaction process.

@else
@foreach ($orders as $index => $order)

{{ $order->car->title }}

@php $firstKey = array_key_first($order->payment_history); $lastKey = array_key_last($order->payment_history); $initialDeposit = $order->payment_history[$firstKey]; $lastDeposit = $order->payment_history[$lastKey]; $nextDepositDate = date('d-m-Y', strtotime($lastKey . ' +30 days')); @endphp
Total Financed: ${{ number_format($order->amount_paid) }}
Down Payment: ${{ number_format($initialDeposit) }}
Monthly Installment: ${{ number_format($order->monthly_plan) }}
Payment Duration: {{ $order->duration }} months
Last Deposit Date: {{ $lastKey }}
Next Deposit Date: {{ $nextDepositDate }}

Top offer

${{ number_format($order->car_price) }}

@endforeach
@endif