diff --git a/src/Eloquent/Relations/Traits/IsOfDescendantsRelation.php b/src/Eloquent/Relations/Traits/IsOfDescendantsRelation.php index 2c3a882..ca8ea88 100644 --- a/src/Eloquent/Relations/Traits/IsOfDescendantsRelation.php +++ b/src/Eloquent/Relations/Traits/IsOfDescendantsRelation.php @@ -220,6 +220,7 @@ protected function addExpression(callable $constraint, ?Builder $query = null, $ { $name = $this->parent->getExpressionName(); + /** @var \Staudenmeir\LaravelAdjacencyList\Eloquent\Builder<\Illuminate\Database\Eloquent\Model> $query */ $query = $query ?: $this->query; $grammar = $this->getExpressionGrammar(); @@ -229,7 +230,6 @@ protected function addExpression(callable $constraint, ?Builder $query = null, $ $this->getRecursiveQuery($grammar, $selectPath) ); - /** @var \Staudenmeir\LaravelAdjacencyList\Eloquent\Builder<\Illuminate\Database\Eloquent\Model> $query */ $query->getQuery()->withRecursiveExpression($name, $expression->getQuery()); $query->withGlobalScope(get_class($this), function (Builder $query) use ($name) {