File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -774,16 +774,22 @@ public function dispatch(Request $request)
774774
775775 if ( ! is_null ($ response ))
776776 {
777- return $ this ->prepare ($ response , $ request );
777+ $ response = $ this ->prepare ($ response , $ request );
778778 }
779779
780- $ this ->currentRoute = $ route = $ this ->findRoute ($ request );
781-
782780 // Once we have the route, we can just run it to get the responses, which will
783781 // always be instances of the Response class. Once we have the responses we
784782 // will execute the global "after" middlewares to finish off the request.
785- $ response = $ route ->run ($ request );
783+ else
784+ {
785+ $ this ->currentRoute = $ route = $ this ->findRoute ($ request );
786+
787+ $ response = $ route ->run ($ request );
788+ }
786789
790+ // Finally after the route has been run we can call the after and close global
791+ // filters for the request, giving a chance for any final processing to get
792+ // done before the response gets returned back to the user's web browser.
787793 $ this ->callAfterFilter ($ request , $ response );
788794
789795 return $ response ;
You can’t perform that action at this time.
0 commit comments