Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Model updates for #3200
James Cole117affb1d42d
diff --git a/app/Models/Account.php b/app/Models/Account.phpindex 1b92e96505..6028d5920b 100644--- a/app/Models/Account.php+++ b/app/Models/Account.php@@ -143,6 +143,13 @@ class Account extends Modelthrow new NotFoundHttpException;}+ /**+ * Get all of the tags for the post.+ */+ public function objectGroups()+ {+ return $this->morphToMany(ObjectGroup::class, 'object_groupable');+ }/*** @codeCoverageIgnorediff --git a/app/Models/ObjectGroup.php b/app/Models/ObjectGroup.phpindex 0505a63e1f..89a425c2f6 100644--- a/app/Models/ObjectGroup.php+++ b/app/Models/ObjectGroup.php@@ -85,6 +85,14 @@ class ObjectGroup extends Modelreturn $this->morphedByMany(Bill::class, 'object_groupable');}+ /**+ * @return \Illuminate\Database\Eloquent\Relations\MorphToMany+ */+ public function accounts()+ {+ return $this->morphedByMany(Account::class, 'object_groupable');+ }+/*** Route binder. Converts the key in the URL to the specified object (or throw 404).*@@ -97,6 +105,7 @@ class ObjectGroup extends Model{if (auth()->check()) {$objectGroupId = (int) $value;+ /** @var ObjectGroup $objectGroup */$objectGroup = self::where('object_groups.id', $objectGroupId)->where('object_groups.user_id', auth()->user()->id)->first();if (null !== $objectGroup) {