diff --git a/routes/web.php b/routes/web.php index 5c98f87a..cc13fc90 100644 --- a/routes/web.php +++ b/routes/web.php @@ -240,13 +240,17 @@ Route::post('/support', function (Request $request) { if($billNo) { $transaction = Transaction::where('bill_no', $billNo)->first(); - $booking = $transaction->booking; + if($transaction){ + $booking = $transaction->booking; + } } if($autocountDocNoInvoice) { $kvp = KeyValuePair::where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE)->where('value', $autocountDocNoInvoice)->first(); - $transaction = $kvp->owner()->withTrashed()->first(); - $booking = $transaction ? $transaction->booking : null; + if($kvp){ + $transaction = $kvp->owner()->withTrashed()->first(); + $booking = $transaction ? $transaction->booking : null; + } } return view('pages.customer_support', [