From 24bcc70cd621b8150171723dc488f7346b42be75 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 24 Feb 2023 12:47:34 +1100 Subject: [PATCH] Add guards on invoice_id --- app/Http/Requests/Expense/UpdateExpenseRequest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Requests/Expense/UpdateExpenseRequest.php b/app/Http/Requests/Expense/UpdateExpenseRequest.php index a8b0ee9682..d050e63e61 100644 --- a/app/Http/Requests/Expense/UpdateExpenseRequest.php +++ b/app/Http/Requests/Expense/UpdateExpenseRequest.php @@ -46,6 +46,9 @@ class UpdateExpenseRequest extends Request } $rules['category_id'] = 'bail|sometimes|nullable|exists:expense_categories,id,company_id,'.auth()->user()->company()->id.',is_deleted,0'; + $rules['transaction_id'] = 'bail|sometimes|nullable|exists:bank_transactions,id,company_id,'.auth()->user()->company()->id; + $rules['invoice_id'] = 'bail|sometimes|nullable|exists:invoices,id,company_id,'.auth()->user()->company()->id; + return $this->globalRules($rules); }