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
134
134
$ nullParentQuery = $ this ->evaluate ($ this ->modifyQueryUsing , ['query ' => $ nullParentQuery ]);
135
135
}
136
136
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 ();
140
144
141
145
// Combine the results from both queries
142
146
$ combinedResults = $ nullParentResults ->concat ($ nonNullParentResults );
You can’t perform that action at this time.
0 commit comments