File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ public function dispatch(Request $request)
157157
158158 $ this ->container ->instance ('Illuminate\Http\Request ' , $ request );
159159
160+ ApiResponse::getTransformer ()->setRequest ($ request );
161+
160162 try {
161163 $ response = parent ::dispatch ($ request );
162164 } catch (Exception $ exception ) {
@@ -283,10 +285,6 @@ protected function prepareResponse($request, $response)
283285
284286 if ($ response instanceof IlluminateResponse && $ this ->requestTargettingApi ($ request )) {
285287 $ response = ApiResponse::makeFromExisting ($ response );
286- }
287-
288- if ($ response instanceof ApiResponse) {
289- ApiResponse::getTransformer ()->setRequest ($ request );
290288 }
291289
292290 if ($ response ->isSuccessful () && $ this ->getConditionalRequest ()) {
You can’t perform that action at this time.
0 commit comments