From 088abcc790265013111a9fe647e965e092c7ae4e Mon Sep 17 00:00:00 2001 From: Adam Huttler Date: Tue, 19 Nov 2024 08:13:29 -1000 Subject: [PATCH] Update HasParent.php --- src/HasParent.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/HasParent.php b/src/HasParent.php index 10051d4..4ec4496 100644 --- a/src/HasParent.php +++ b/src/HasParent.php @@ -41,8 +41,11 @@ public static function bootHasParent(): void } }); - $parentObservedBy = (new static)->getParentClass()::resolveObserveAttributes(); - static::observe($parentObservedBy); + + if (method_exists(static::class, 'resolveObserveAttributes')) { + $parentObservedBy = (new static)->getParentClass()::resolveObserveAttributes(); + static::observe($parentObservedBy); + } } public function parentHasHasChildrenTrait(): bool