From 83234cfac37a0bd9f0adc420709af99fa5a8e355 Mon Sep 17 00:00:00 2001 From: harshjagad20 Date: Sat, 22 May 2021 13:52:30 +0530 Subject: [PATCH] get custom field by slug in models --- app/Models/Estimate.php | 5 +++++ app/Models/Expense.php | 5 +++++ app/Models/Payment.php | 5 +++++ app/Models/User.php | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/app/Models/Estimate.php b/app/Models/Estimate.php index ee98cfa9..43b92b75 100644 --- a/app/Models/Estimate.php +++ b/app/Models/Estimate.php @@ -510,4 +510,9 @@ class Estimate extends Model implements HasMedia '{ESTIMATE_LINK}' => url('/customer/estimates/pdf/'.$this->unique_hash), ]; } + + public function getValues($slug) + { + return $this->getCustomFieldValues($slug); + } } diff --git a/app/Models/Expense.php b/app/Models/Expense.php index 752c245c..e3764bbe 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -219,4 +219,9 @@ class Expense extends Model implements HasMedia return true; } + + public function getValues($slug) + { + return $this->getCustomFieldValues($slug); + } } diff --git a/app/Models/Payment.php b/app/Models/Payment.php index d20f360e..65e7f25e 100644 --- a/app/Models/Payment.php +++ b/app/Models/Payment.php @@ -446,4 +446,9 @@ class Payment extends Model implements HasMedia '{PAYMENT_LINK}' => $this->paymentPdfUrl, ]; } + + public function getValues($slug) + { + return $this->getCustomFieldValues($slug); + } } diff --git a/app/Models/User.php b/app/Models/User.php index 95307a92..b3f2484d 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -422,4 +422,9 @@ class User extends Authenticatable implements HasMedia return $companySettings; } + + public function getValues($slug) + { + return $this->getCustomFieldValues($slug); + } }