Exemple #1
0
 /**
  * @param \Symfony\Component\HttpFoundation\Response $response
  * @param \Exception                                 $exception
  *
  * @return \Illuminate\Http\Response
  */
 protected function toIlluminateResponse($response, Exception $exception)
 {
     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($exception);
 }
 /**
  * @param RedirectResponse $response
  * @return string
  */
 private function renderRedirectScript(RedirectResponse $response)
 {
     return '<script>window.location = "' . $response->getTargetUrl() . '"</script>';
 }