File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -550,16 +550,11 @@ public function getTreeUsing(Closure|array $value): static
550550 return $ this ;
551551 }
552552
553- public function getTree (): Collection | array
553+ public function getTree (): Collection
554554 {
555- if ($ this ->getTreeUsing ) {
556- return $ this ->evaluate ($ this ->getTreeUsing );
557- }
558-
559- return $ this ->evaluate ($ this ->buildTree ()
555+ return Collection::wrap ($ this ->evaluate ($ this ->getTreeUsing ) ?? $ this ->buildTree ())
560556 ->when ($ this ->prepend , fn (Collection $ tree ) => $ tree ->prepend ($ this ->evaluate ($ this ->prepend )))
561- ->when ($ this ->append , fn (Collection $ tree ) => $ tree ->push ($ this ->evaluate ($ this ->append )))
562- );
557+ ->when ($ this ->append , fn (Collection $ tree ) => $ tree ->push ($ this ->evaluate ($ this ->append )));
563558 }
564559
565560 public function getResults (): Collection |LazyCollection |array |null
You can’t perform that action at this time.
0 commit comments