Skip to content

Commit

Permalink
Support ObservedBy attribute in parent class
Browse files Browse the repository at this point in the history
  • Loading branch information
adamthehutt authored Nov 19, 2024
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
Expand Up @@ -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
Expand Down

0 comments on commit 875ebf1

Please sign in to comment.