'How to change unpaid status to paid status by selecting confirmed in PHP Laravel

I need help please.

IF Cash on Delivery, I want to change $payment_status to paid when user selects confirmed. Once user has selected confirmed, I don't want for the user to change payment_status back to unpaid

    <div class="row mt-5">
        @if($order->payment_type == 'cash_on_delivery')
        <div class="offset-lg-2 col-lg-4 col-sm-6">
            <div class="form-group">
                <select class="form-control aiz-selectpicker form-control-sm"  data-minimum-results-for-search="Infinity" id="update_payment_status">
                    <option value="unpaid" @if ($payment_status == 'unpaid') selected @endif>{{ translate('Unpaid')}}</option>
                    <option value="paid" @if ($payment_status == 'paid') selected @endif>{{ translate('Paid')}}</option>
                </select>
                <label>{{ translate('Payment Status')}}</label>
            </div>
        </div>
        @endif
        <div class="col-lg-4 col-sm-6">
            <div class="form-group">
                <select class="form-control aiz-selectpicker form-control-sm"  data-minimum-results-for-search="Infinity" id="update_delivery_status">
                    <option value="cancelled"   @if ($status == 'cancelled') selected @endif>{{translate('Cancel')}}</option>
                    <option value="pending"     @if ($status == 'pending') selected @endif>{{translate('Pending')}}</option>
                    <option value="confirmed"   @if ($status == 'confirmed') selected @endif>{{translate('Confirmed')}}</option>
                    <option value="picked_up"   @if ($status == 'picked_up') selected @endif>{{translate('Picked Up')}}</option>
                    <option value="on_the_way"  @if ($status == 'on_the_way') selected @endif>{{translate('On The Way')}}</option>
                    <option value="delivered"   @if ($status == 'delivered') selected @endif>{{translate('Delivered')}}</option>
                </select>
                <label>{{ translate('Delivery Status')}}</label>
            </div>
        </div>
    </div>
php


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source