From 03368ff1d9dcff9d29efc2c69525ff4e26e7d97c Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Fri, 30 Sep 2022 16:27:34 +0800 Subject: [PATCH] fix smc profile can't load bug --- app/Http/Resources/WalletTransactionResource.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Resources/WalletTransactionResource.php b/app/Http/Resources/WalletTransactionResource.php index cfc8ab10..2805faed 100644 --- a/app/Http/Resources/WalletTransactionResource.php +++ b/app/Http/Resources/WalletTransactionResource.php @@ -27,7 +27,8 @@ class WalletTransactionResource extends JsonResource $description = 'Credit Voucher for '.$this->payment_reference; break; case 1: - $marking = Transaction::where('payment_reference', $this->bill_no)->first()->owner->marking; + $bill = Transaction::where('payment_reference', $this->bill_no)->first(); + $marking = $bill ? $bill->owner->marking : 'Unknown'; $description = 'Payment For booking refs.'.''.$marking.''; break; case 11: