Create a new redirect response to a named route.

@param  string  $route
@param  array   $parameters
@param  int     $status
@param  array   $headers
@return \Symfony\Component\HttpFoundation\Response
347144
public function redirectToRoute($route, $parameters = array(), $status = 302, $headers = array())
	{
		return $this->redirector->route($route, $parameters, $status, $headers);
	}
1192300
protected function redirectToAction(
        $action,
        array $parameters = [],
        $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH,
        $status = 302
    ) {
        $url = $this->container->get(AdminRouter::class)
            ->generateAdminPath($this->admin, $action, $parameters, $referenceType);

        return new RedirectResponse($url, $status);
    }
439695
public function redirectGuest($path, $status = 302, $headers = [], $secure = null)
    {
        respondWith(response()->redirectGuest($path, $status, $headers, $secure));
    }
607933
public function createRedirectResponse(Request $request, $path, $status = 302)
    {
        return new RedirectResponse($this->httpUtils->generateUri($request, $path), $status);
    }
429739
public function redirectIntended($path, $status = 302, $headers = [], $secure = null)
    {
        return Redirect::intended($this->uri() . '/' . $path, $status, $headers, $secure);
    }
775258
public function redirect($location, $status = 302)
    {
        if (!$location) {
            return;
        }
        $this->status($status);
        $headers = $this->headers();
        $headers['Location'] = $location;
        return $this;
    }
1367305
public function redirect($uri, $destination, $status = 302)
    {
        return $this->any($uri, '\Illuminate\Routing\RedirectController')
                ->defaults('destination', $destination)
                ->defaults('status', $status);
    }
1135549
protected function doPost(string $path, array $parameters = [], array $headers = [])
    {
        $body = \json_encode($parameters);

        $request = $this
            ->getInstapushClient()
            ->getRequestFactory()
            ->createRequest('POST', $path, $headers, $body);

        $this->setRequest($request);

        $response = $this
            ->getInstapushClient()
            ->getHttpClient()
            ->sendRequest($request);

        $this->setResponse($response);

        return $this;
    }
142963
private function addHeaders(Request $request, Route $route, $headers)
    {
        // set the proper domain
        if ($route->getDomain()) {
            $request->headers->add([
                'HOST' => $route->getDomain(),
            ]);
            $request->server->add([
                'HTTP_HOST' => $route->getDomain(),
                'SERVER_NAME' => $route->getDomain(),
            ]);
        }

        $headers = collect($headers);

        if (($headers->get('Accept') ?: $headers->get('accept')) === 'application/json') {
            $request->setRequestFormat('json');
        }

        return $request;
    }
311297
public function dispatchRoute(Parsed $route, array $parameters = [])
    {
        $handler = $route->getHandler();
        if (isset($handler['controler']) && isset($handler['action'])) {
            $routePlaceholders             = $route->getPlaceholders();
            list($controllerName, $action) = $this->resolveControlerAction(
                $route->getParameters(),
                $routePlaceholders,
                $handler
            );

            // Create instance of target class
            $controller = new $controllerName();
            // Create class method name with prefix
            $methodName = $this->actionName.$action;

            $parameterMap = $this->getMethodParameters(
                $controllerName,
                $methodName
            );

            $methodParameters = $this->getFunctionArgumentsControlers(
                $parameterMap,
                $route->getParameters(),
                $routePlaceholders,
                $handler
            );

            return call_user_func_array(
                [
                    $controller,
                    $methodName
                ],
                $methodParameters
            );
        }

        return $this->dispatchNotFound();
    }
1328859
public static function redirect($url, array $parameters = [], int $statusCode = Response::STATUS_MOVED_PERMANENTLY) : Response
    {
        if (!empty($parameters)) {
            $url = $url . '?' . http_build_query($parameters);
        }

        $headers = new Headers();
        $headers->add(new Header('Location', $url));

        return new Response('', $statusCode, $headers);
    }
372774
public function respond($response, $status, $headers, $options)
    {
        switch ($this->getRequestFormat()) {
            case 'html' :
            case 'text/html' :
                return Response::make($response, $status, $headers, $options)
                    ->header('Content-Type', 'text/html');
            default :
                // whether 'Content-Type' is NULL or equal to anything such as 'application/json' response will be JSON
                return Response::json($response, $status, $headers, $options);
        }
    }
1304944
public function to($path, $status = 302, $headers = [], $secure = null)
    {
        $path = $this->app->make('url')->to($path, [], $secure);

        return $this->createRedirect($path, $status, $headers);
    }
374503
public function redirectTo($path, $status = 302, $headers = array(), $secure = null)
	{
		return $this->redirector->to($path, $status, $headers, $secure);
	}
617208
public static function add($route, $parameters)
    {
        self::$route = $route;
        array_shift($parameters);
        self::$parameters = $parameters;
    }
518229
public function redirect($url, array $params = [], $status = 302)
    {
        if (!empty($params)) {
            $url = rtrim(preg_replace('/\?.*/', '', $url), '/');
            $url .= "?" . http_build_query($params);
        }

        $this->statusCode = $status;
        $this->headers->set('Location', $url);

        $this->getMbAudit()->setResponseType('redirect');
        $this->getMbAudit()->setResponseData([
            'url' => $url,
        ]);

        return true;
    }
1180450
protected function redirectToRoute(string $route, $parameters = [], int $status = 302): RedirectResponse
    {
        return $this->redirect($this->generateUrl($route, $parameters), $status);
    }