File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -141,11 +141,17 @@ public function setResponseMeta(array $meta = [])
141
141
*/
142
142
private function buildQuery (Request $ request )
143
143
{
144
+ $ query = $ this ->model ->query ();
145
+
146
+ $ queryManipulator = $ this ->queryManipulator ;
147
+
148
+ if ($ queryManipulator ) {
149
+ $ queryManipulator ($ query );
150
+ }
151
+
144
152
$ orderByField = $ request ->get ('orderByField ' );
145
153
$ orderByDirection = $ request ->get ('orderByDirection ' );
146
154
147
- $ query = $ this ->model ->query ();
148
-
149
155
if ($ orderByField && $ orderByDirection ) {
150
156
if (!in_array (strtolower ($ orderByDirection ), ['asc ' , 'desc ' ])) {
151
157
throw new InvalidArgumentException ('Order by direction must be either asc or desc. ' );
@@ -161,12 +167,6 @@ private function buildQuery(Request $request)
161
167
}
162
168
}
163
169
164
- $ queryManipulator = $ this ->queryManipulator ;
165
-
166
- if ($ queryManipulator ) {
167
- $ queryManipulator ($ query );
168
- }
169
-
170
170
return $ query ;
171
171
}
172
172
You can’t perform that action at this time.
0 commit comments