diff --git a/src/SelectTree.php b/src/SelectTree.php index 90febae..12a432f 100644 --- a/src/SelectTree.php +++ b/src/SelectTree.php @@ -87,7 +87,7 @@ private function buildTree(): Collection $nullParentQuery = $this->getRelationship()->getRelated()->query()->where($this->getParentAttribute(), $this->getParentNullValue()); $nonNullParentQuery = $this->getRelationship()->getRelated()->query()->whereNot($this->getParentAttribute(), $this->getParentNullValue()); - // If we're not at the root level and a modification callback is provided, apply it to both queries. + // If we're not at the root level and a modification callback is provided, apply it to null query if ($this->modifyQueryUsing) { $nullParentQuery = $this->evaluate($this->modifyQueryUsing, ['query' => $nullParentQuery]); }