Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support ObservedBy attribute in parent class
Browse files Browse the repository at this point in the history
adamthehutt authored Nov 19, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 90e80a9 commit 875ebf1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/HasParent.php
Original file line number Diff line number Diff line change
@@ -40,6 +40,9 @@ public static function bootHasParent(): void
$query->where($query->getModel()->getTable() . '.' . $instance->getInheritanceColumn(), $instance->classToAlias(get_class($instance)));
}
});

$parentObservedBy = (new static)->getParentClass()::resolveObserveAttributes();
static::observe($parentObservedBy);
}

public function parentHasHasChildrenTrait(): bool

0 comments on commit 875ebf1

Please sign in to comment.