File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,9 @@ protected function setUp(): void
8484 private function buildTree ($ parent = null ): array |Collection
8585 {
8686 // Assign the parent's null value to the $parent variable if it's not null
87- $ parent = $ this ->getParentNullValue () ?? $ parent ;
87+ if ($ parent == null || $ parent == $ this ->getParentNullValue ()) {
88+ $ parent = $ this ->getParentNullValue () ?? $ parent ;
89+ }
8890
8991 // Create a default query to retrieve related items.
9092 $ defaultQuery = $ this ->getRelationship ()
@@ -93,7 +95,7 @@ private function buildTree($parent = null): array|Collection
9395 ->where ($ this ->getParentAttribute (), $ parent );
9496
9597 // If we're not at the root level and a modification callback is provided, apply it to the query.
96- if (! $ parent && $ this ->modifyQueryUsing ) {
98+ if (!$ parent && $ this ->modifyQueryUsing ) {
9799 $ defaultQuery = $ this ->evaluate ($ this ->modifyQueryUsing , ['query ' => $ defaultQuery ]);
98100 }
99101
You can’t perform that action at this time.
0 commit comments