From 9f9bcb0fce9ad472c4eb9d7be996890fa071d1ea Mon Sep 17 00:00:00 2001 From: = Date: Mon, 10 May 2021 18:27:51 +1000 Subject: [PATCH] Add history and activities relations' --- app/Models/RecurringInvoice.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 3790ca91cfbf..44b9427e5002 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -157,6 +157,16 @@ class RecurringInvoice extends BaseModel return $value; } + public function activities() + { + return $this->hasMany(Activity::class)->orderBy('id', 'DESC')->take(300); + } + + public function history() + { + return $this->hasManyThrough(Backup::class, Activity::class); + } + public function company() { return $this->belongsTo(Company::class);