Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
staudenmeir committed Aug 25, 2024
1 parent e8ebff0 commit 9f9ac47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Eloquent/Graph/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function toTree(string $childrenRelation = 'children'): static

$depths = $this->pluck($depthName);

$graph = new static(
$tree = new static(
$this->where($depthName, $depths->min())->values()
);

Expand All @@ -49,6 +49,6 @@ public function toTree(string $childrenRelation = 'children'): static
);
}

return $graph;
return $tree;
}
}

0 comments on commit 9f9ac47

Please sign in to comment.