public function handleResponse(Request $request, Response $response)
    {
        if ($response->getStatusCode() == 422) {
            $errors = $response->getOriginalContent()['validation_errors'];

            throw new HttpResponseException(
                redirect()->back()->withInput($request->input())->withErrors($errors)
            );
        }

        if ($response->getStatusCode() == 403) {
            abort(403);
        }

        return $response->isNotFound() ? abort(404) : $response->getOriginalContent();
    }
public function handleResponse(Request $request, Response $response)
    {
        if ($response->getStatusCode() == 422) {
            $errors = $response->getOriginalContent()['validation_errors'];

            throw new HttpResponseException(
                redirect()->back()->withInput($request->input())->withErrors($errors)
            );
        }

        if ($response->getStatusCode() == 403) {
            abort(403);
        }

        return $response->isNotFound() ? abort(404) : $response->getOriginalContent();
    }
public function handleResponse ( Request $ request , Response $ response ) { if ( $ response -> getStatusCode ( ) == 422 ) { $ errors = $ response -> getOriginalContent ( ) [ 'validation_errors' ] ; throw new HttpResponseException ( redirect ( ) -> back ( ) -> withInput ( $ request -> input ( ) ) -> withErrors ( $ errors ) ) ; } if ( $ response -> getStatusCode ( ) == 403 ) { abort ( 403 ) ; } return $ response -> isNotFound ( ) ? abort ( 404 ) : $ response -> getOriginalContent ( ) ; }
Handle a response from the dispatcher for the given request.

@param  Request  $request
@param  Response  $response
@return Response|mixed
Handle a response from the dispatcher for the given request .