File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -134,9 +134,13 @@ private function buildTree(): Collection
134134 $ nullParentQuery = $ this ->evaluate ($ this ->modifyQueryUsing , ['query ' => $ nullParentQuery ]);
135135 }
136136
137- // Fetch results for both queries
138- $ nullParentResults = $ nullParentQuery ->withTrashed ($ this ->withTrashed )->get ();
139- $ nonNullParentResults = $ nonNullParentQuery ->withTrashed ($ this ->withTrashed )->get ();
137+ if ($ this ->withTrashed ) {
138+ $ nullParentQuery ->withTrashed ($ this ->withTrashed );
139+ $ nonNullParentQuery ->withTrashed ($ this ->withTrashed );
140+ }
141+
142+ $ nullParentResults = $ nullParentQuery ->get ();
143+ $ nonNullParentResults = $ nonNullParentQuery ->get ();
140144
141145 // Combine the results from both queries
142146 $ combinedResults = $ nullParentResults ->concat ($ nonNullParentResults );
You can’t perform that action at this time.
0 commit comments