From c94c3fa37383abaf74c1fd5fc73deb0a58edaf03 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 27 Feb 2021 08:37:56 +1100 Subject: [PATCH] Add project relationships across all entities --- app/Models/Credit.php | 5 +++++ app/Models/Quote.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/app/Models/Credit.php b/app/Models/Credit.php index 8f942d0ea15b..aecb446a18a5 100644 --- a/app/Models/Credit.php +++ b/app/Models/Credit.php @@ -152,6 +152,11 @@ class Credit extends BaseModel return $this->hasMany(CreditInvitation::class); } + public function project() + { + return $this->belongsTo(Project::class)->withTrashed(); + } + /** * The invoice which the credit has been created from. */ diff --git a/app/Models/Quote.php b/app/Models/Quote.php index d23451290ffd..9038c6ef3b62 100644 --- a/app/Models/Quote.php +++ b/app/Models/Quote.php @@ -149,6 +149,11 @@ class Quote extends BaseModel return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed(); } + public function project() + { + return $this->belongsTo(Project::class)->withTrashed(); + } + public function invitations() { return $this->hasMany(QuoteInvitation::class);