Unserialize error on PJAX update div

I have a customer view page where I can show their unpaid invoices by month. By default it will show the current month but there will be links to the past month and next month.

I want to use PJAX call to update unpaid invoices list by selected month, but it gave me unserialize error. Can someone help me on how to implement PJAX on this case?

Below is my controller code

public function actionView($id, $unpaidPeriod = null) {
    $request = Yii::$app->request;

    $model = $this->findModel($id);
    
    $unpaidPeriod = empty($unpaidPeriod) ? date('Y-m-d') : $unpaidPeriod;
    $unpaidPeriodBef = date('Y-m-d', strtotime($unpaidPeriod . '-1 month'));
    $unpaidPeriodAft = date('Y-m-d', strtotime($unpaidPeriod . '+1 month'));

    return $this->render('view', [
            'model' => $model,
            'unpaidPeriod' => $unpaidPeriod, 'unpaidPeriodBef' => $unpaidPeriodBef, 'unpaidPeriodAft' => $unpaidPeriodAft,
            ]);
}

and below is the view code

...
[customer detail view]
....
    <?php Pjax::begin(['id' => 'unpaid-invoice-pjax']) ?>

    <div class="row" style="margin-top: 50px; margin-bottom: 20px; display: flex; align-items: baseline;">
        <span class="col-md-2 text-left">
            <?= Html::a(Html::icon('glyphicon glyphicon-chevron-left') . ' ' . Yii::$app->formatter->asDate($unpaidPeriodBef, 'php: F Y'), Url::to(['view', 'id' => $model->id, 'unpaidPeriod' => $unpaidPeriodBef]), ['data-pjax' => '#unpaid-invoice-pjax', 'class' => 'btn btn-xs btn-info']) ?>
        </span>
        <span class="col-md-8 text-center">
            <legend><?= Yii::t('app', 'Unpaid invoice list') . ' ' . Yii::$app->formatter->asDate($unpaidPeriod, 'php: F Y') ?></legend>
        </span>
        <span class="col-md-2 text-right">
            <?php if (date('Y-m-d', strtotime($unpaidPeriodAft)) <= date('Y-m-d')) { ?>
                <?= Html::a(Html::icon('glyphicon glyphicon-chevron-right') . ' ' . Yii::$app->formatter->asDate($unpaidPeriodAft, 'php: F Y'), Url::to(['view', 'id' => $model->id, 'unpaidPeriod' => $unpaidPeriodAft]), ['data-pjax' => '#unpaid-invoice-pjax', 'class' => 'btn btn-xs btn-info']) ?>
            <?php } ?>
        </span>
    </div>

    <table class="table table-bordered table-condensed table-striped">
        <tr>
            <th class="text-center" style="width: 150px;"><?= FormHeader::instance()->getAttributeLabel('formNo') ?></th>
            <th class="text-center" style="width: 200px;"><?= FormHeader::instance()->getAttributeLabel('formDate') ?></th>
            <th class="text-center" style="width: 150px;"><?= FormHeader::instance()->getAttributeLabel('totalCharges') ?></th>
            <th class="text-center"><?= FormHeader::instance()->getAttributeLabel('memo') ?></th>
            <th class="text-center" style="width: 50px;">&nbsp;</th>
        </tr>
        <?php if (empty($model->getMonthlyUnpaidInvoices($unpaidPeriod)->all())) { ?>
            <tr>
                <th colspan="5"><?= Html::tag('strong', Yii::t('app', 'No data available'), ['class' => 'text-danger bg-danger', 'style' => 'padding: 3px 8px;']) ?></th>
            </tr>
        <?php } else { ?>
            <?php $totInvoices = 0; ?>
            <?php foreach ($model->getMonthlyUnpaidInvoices($unpaidPeriod)->all() as $invoice) { ?>
                <?php $totInvoices += $invoice->totalInvoice; ?>
                <tr>
                    <td class="text-center"><?= Html::a($invoice->formNo, Url::to(['/forms/warehouse-sales/view', 'id' => $invoice->id])) ?></td>
                    <td class="text-center"><?= Yii::$app->formatter->asDate($invoice->formDate) ?></td>
                    <td class="text-right"><?= Yii::$app->formatter->asDecimal($invoice->totalInvoice) ?></td>
                    <td><?= $invoice->memo ?></td>
                    <td class="text-center">
                        <?=
                        Html::a(
                                Html::icon('glyphicon glyphicon-usd') . ' ' . Yii::t('app', 'Pay'), Url::to(['/forms/warehouse-sales/pay', 'id' => $invoice->id, 'custview' => 1]), [
                            'class' => 'btn btn-xs btn-success',
                            'title' => Yii::t('app', 'Pay'),
                            'data-pjax' => 0,
                            'data-method' => 'post',
                            'data-confirm' => Yii::t('app', 'Are you sure you want to set the status to Paid?'),
                                ]
                        )
                        ?>
                    </td>
                </tr>
            <?php } ?>
            <tr>
                <th class="text-center" colspan="2"><?= Yii::t('app', 'TOTAL') ?></th>
                <th class="text-right"><?= Yii::$app->formatter->asDecimal($totInvoices) ?></th>
                <th colspan="2">&nbsp;</th>
            </tr>
        <?php } ?>
    </table>
    <?php Pjax::end() ?>
....

Below is the error message from yii debug

unserialize('O:31:"yii\\base\\UnknownMethodException":7:{s:10:"' . "\0" . '*' . "\0" . 'message";s:0:"";s:17:"' . "\0" . 'Exception' . "\0" . 'string";s:0:"";s:7:"' . "\0" . '*' . "\0" . 'code";i:0;s:7:"' . "\0" . '*' . "\0" . 'file";s:81:"/home/dadinugroho/projects/xinsys/vendor/opis/closure/src/SerializableClosure.php";s:7:"' . "\0" . '*' . "\0" . 'line";i:415;s:16:"' . "\0" . 'Exception' . "\0" . 'trace";a:10:{i:0;a:5:{s:4:"file";s:81:"/home/dadinugroho/projects/xinsys/vendor/opis/closure/src/SerializableClosure.php";s:4:"line";i:415;s:8:"function";s:29:"newInstanceWithoutConstructor";s:5:"class";s:15:"ReflectionClass";s:4:"type";s:2:"->";}i:1;a:5:{s:4:"file";s:81:"/home/dadinugroho/projects/xinsys/vendor/opis/closure/src/SerializableClosure.php";s:4:"line";i:390;s:8:"function";s:12:"wrapClosures";s:5:"class";s:32:"Opis\\Closure\\SerializableClosure";s:4:"type";s:2:"::";}i:2;a:5:{s:4:"file";s:81:"/home/dadinugroho/projects/xinsys/vendor/opis/closure/src/SerializableClosure.php";s:4:"line";i:390;s:8:"function";s:12:"wrapClosures";s:5:"class";s:32:"Opis\\Closure\\SerializableClosure";s:4:"type";s:2:"::";}i:3;a:5:{s:4:"file";s:81:"/home/dadinugroho/projects/xinsys/vendor/opis/closure/src/SerializableClosure.php";s:4:"line";i:390;s:8:"function";s:12:"wrapClosures";s:5:"class";s:32:"Opis\\Closure\\SerializableClosure";s:4:"type";s:2:"::";}i:4;a:5:{s:4:"file";s:67:"/home/dadinugroho/projects/xinsys/vendor/opis/closure/functions.php";s:4:"line";i:19;s:8:"function";s:12:"wrapClosures";s:5:"class";s:32:"Opis\\Closure\\SerializableClosure";s:4:"type";s:2:"::";}i:5;a:3:{s:4:"file";s:77:"/home/dadinugroho/projects/xinsys/vendor/yiisoft/yii2-debug/src/LogTarget.php";s:4:"line";i:62;s:8:"function";s:22:"Opis\\Closure\\serialize";}i:6;a:5:{s:4:"file";s:77:"/home/dadinugroho/projects/xinsys/vendor/yiisoft/yii2-debug/src/LogTarget.php";s:4:"line";i:136;s:8:"function";s:6:"export";s:5:"class";s:19:"yii\\debug\\LogTarget";s:4:"type";s:2:"->";}i:7;a:5:{s:4:"file";s:72:"/home/dadinugroho/projects/xinsys/vendor/yiisoft/yii2/log/Dispatcher.php";s:4:"line";i:189;s:8:"function";s:7:"collect";s:5:"class";s:19:"yii\\debug\\LogTarget";s:4:"type";s:2:"->";}i:8;a:5:{s:4:"file";s:68:"/home/dadinugroho/projects/xinsys/vendor/yiisoft/yii2/log/Logger.php";s:4:"line";i:177;s:8:"function";s:8:"dispatch";s:5:"class";s:18:"yii\\log\\Dispatcher";s:4:"type";s:2:"->";}i:9;a:3:{s:8:"function";s:5:"flush";s:5:"class";s:14:"yii\\log\\Logger";s:4:"type";s:2:"->";}}s:19:"' . "\0" . 'Exception' . "\0" . 'previous";N;}')

TIA

Daniel