From bec9f121ab24ec01c2e176ae087c2dfb4c96ee22 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 17 Dec 2021 12:02:01 +0800 Subject: [PATCH] add packing list relationship in packing list model --- app/Models/PackingList.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Models/PackingList.php b/app/Models/PackingList.php index 24565d9c..21b0d692 100644 --- a/app/Models/PackingList.php +++ b/app/Models/PackingList.php @@ -72,4 +72,12 @@ class PackingList extends AbstractModel implements Transportable, Steppable, Pac { return $this->BelongsToMany(PackingList::class, 'packing_list_owner', 'owner_packing_list_id', 'packing_list_id'); } + + /** + * @return MorphMany + */ + public function packingLists(): morphMany + { + return $this->morphMany(PackingList::class, 'owner'); + } }