protected function toIlluminateResponse($response, Exception $e)
    {
        if ($response instanceof SymfonyRedirectResponse) {
            $response = new RedirectResponse(
                $response->getTargetUrl(), $response->getStatusCode(), $response->headers->all()
            );
        } else {
            $response = new Response(
                $response->getContent(), $response->getStatusCode(), $response->headers->all()
            );
        }

        return $response->withException($e);
    }
protected function toIlluminateResponse($response, Exception $e)
    {
        if ($response instanceof SymfonyRedirectResponse) {
            $response = new RedirectResponse(
                $response->getTargetUrl(), $response->getStatusCode(), $response->headers->all()
            );
        } else {
            $response = new Response(
                $response->getContent(), $response->getStatusCode(), $response->headers->all()
            );
        }

        return $response->withException($e);
    }
protected function toIlluminateResponse ( $ response , Exception $ e ) { if ( $ response instanceof SymfonyRedirectResponse ) { $ response = new RedirectResponse ( $ response -> getTargetUrl ( ) , $ response -> getStatusCode ( ) , $ response -> headers -> all ( ) ) ; } else { $ response = new Response ( $ response -> getContent ( ) , $ response -> getStatusCode ( ) , $ response -> headers -> all ( ) ) ; } return $ response -> withException ( $ e ) ; }
Map the given exception into an Illuminate response.

@param  \Symfony\Component\HttpFoundation\Response  $response
@param  \Exception  $e
@return \Illuminate\Http\Response
Map the given exception into an Illuminate response .