Returns redirect response with notification.

@return RedirectResponse
974083
public function redirect() : RedirectResponse {
        if( ! $this->notified) {
            $this->notify();
        }

        $url = $this->url ?: app(UrlGenerator::class)->previous();

        return response()->redirectTo($url);
    }
282123
protected function redirectToExternalLogin()
    {
        $loginURL = Security::create()->Link('login');
        $loginURLATT = Convert::raw2att($loginURL);
        $loginURLJS = Convert::raw2js($loginURL);
        $message = _t(
            __CLASS__ . '.INVALIDUSER',
            '<p>Invalid user. <a target="_top" href="{link}">Please re-authenticate here</a> to continue.</p>',
            'Message displayed to user if their session cannot be restored',
            array('link' => $loginURLATT)
        );
        $response = $this->getResponse();
        $response->setStatusCode(200);
        $response->setBody(<<<PHP
<!DOCTYPE html>
<html><body>
$message
<script type="application/javascript">
setTimeout(function(){top.location.href = "$loginURLJS";}, 0);
</script>
</body></html>
PHP
        );
        $this->setResponse($response);

        return $response;
    }
64548
public function linkAccount() {
    $sdk = $this->getSdk();

    if ($sdk instanceof RedirectResponse) {
      return $sdk;
    }

    $this->authManager->setSdk($sdk);
    $url = $this->authManager->getAuthenticationUrl('link');

    return new TrustedRedirectResponse($url);
  }
1240773
public function toResponse(): Response
    {
        return new Response(
            $this->status,
            $this->headers,
            $this->body,
            $this->httpVersion,
            $this->reason
        );
    }
649586
public function activateAction()
    {
        $object = $this->getObject();
        
        if (method_exists($object, 'setActive') && method_exists($object, 'getActive')) {
            $object->setActive(($object->getActive()==1) ? 0 : 1);
        }
        
        $this->admin->update($object);        
        
        return new RedirectResponse($this->admin->generateUrl('list'));
    }
136845
public function getResponse()
    {
        if ($this->response === null and $this->isExecuted()) {
            $this->response = Response::forge($this);
        }

        return $this->response;
    }
648586
public function index()
    {
        $this->authorize(RedirectsPolicy::PERMISSION_LIST);

        $redirects = Redirect::query()->paginate(50);

        $this->setTitle($title = trans('seo::redirects.titles.redirections-list'));
        $this->addBreadcrumb($title);

        return $this->view('admin.redirects.index', compact('redirects'));
    }
758450
public function indexAction()
    {
        $response = $this->getResponse();

        $params = $this->params()->fromRoute();
        if ($params['path'] === '') {
            $response->setStatusCode(404);
            return $response;
        }

        $info = pathinfo($params['path']);

        if ($info['dirname'] === '.') {
            $info['dirname'] = '';
        }

        /* @var $folder \CmsFile\Mapping\FolderInterface */
        $folder  = $this->getFolderService()->getMapper()->findOneByPath('/' . trim($info['dirname'], '/'));
        if (!$folder) {
            $response->setStatusCode(404);
            return $response;
        }

        $file = $folder->getFile($info['basename']);
        if (!$file) {
            $response->setStatusCode(404);
            return $response;
        }

        $response = new Stream;
        $response->setStream(fopen($file, 'r'));
        $response->setStatusCode(200);

        $headers = new Headers;
        $headers->addHeaderLine('Content-Type', $file->getType())
            ->addHeaderLine('Content-Disposition', 'attachment; filename="' . $file->getTitle() . '"')
            ->addHeaderLine('Content-Length', filesize($file));

        $response->setHeaders($headers);

        return $response;
    }
421560
public function sendHeaders()
    {
        $codes = $this->getHttpResponseCodes();
        if (!array_key_exists($this->status, $codes)) {
            $this->status = 500;
            $string = 'HTTP/1.0 500 ' . $codes[500];
        } else {
            if ($this->isValidRedirectStatus()) {
                throw new \Exception(
                    'You cannot send a redirect using a regular response. Use $this->response->redirect(url, status);'
                );
            }
            $string = 'HTTP/1.0 ' . $this->status . ' ' . $codes[$this->status];
        }

        header($string);
        $this->outputHeaders();
    }
1153430
public function logout()
	{
		Acct::guard( $this->getGuard() )->logout();

		return Redirect::to( property_exists( $this, 'redirectAfterLogout' ) ? $this->redirectAfterLogout : '/' )->withMessages( [ 'success' => "You are now logged out." ] );
	}
245271
public function send()
    {
        //@TODO when returning the location header during
        //test it fetches the new location even though the
        //code is not redirect
        $this->getResponse()->setContentType('application/json');
        $headers = $this->getResponse()->getHeaders();

        if (isset($headers['Location'])) {
            $headers['Content-Location'] = $headers['Location'];
            unset($headers['Location']);
        }

        //If not padding is set inspect the request query.
        if (empty($this->_padding)) {
            $request = $this->getResponse()->getRequest();
            if ($request->has('callback')) {
                $this->setCallback($request->get('callback'));
            }
        }

        return parent::send();
    }
469200
public function getResponse()
    {
        $this->matcher = new UrlMatcher($this->routes, $this->context);

        $this->parameters = $this->matcher->matchRequest($this->request);

        $controller = $this->parameters['_controller'];
        if ($controller === null) {
            $response = new Response();
        } else {
            $this->controller = new $controller($this->request, $this->parameters);
            $response = $this->controller->handler();
        }

        return $response;
    }
1099915
public function redirect()
    {
        if (headers_sent() === false) {
            header('X-PHP-Response-Code: 403', true, 403);
        }
        if (isset($_GET['template']) === false) {
            return redirect($this->router->generate('login-page'));
        } else {
            return 'Redirect: ' . $this->router->generate('login-page');
        }
    }
207056
public function postReminder() {
    $email = Input::get('email');

    try {
      $this->reminder->send($email);
      return Redirect::to("/user/recupero-success")->with(array ("messageReminder" => L::t('Check your mail inbox, we sent you an email to recover your password.')));
    } catch (Pbi $e) {
      $errors = $this->reminder->getErrors();
      return Redirect::back()->withErrors($errors);
    }
  }
245483
protected function _get()
    {
        $subject = $this->_subject();
        $this->_trigger('beforeLogout', $subject);

        $subject->set([
            'success' => true,
            'redirectUrl' => $this->_controller()->Auth->logout()
        ]);

        $this->_trigger('afterLogout', $subject);
        $this->setFlash('success', $subject);

        return $this->_redirect(
            $subject,
            $subject->redirectUrl
        );
    }
734856
protected function followRedirects()
    {
        while ($this->response->isRedirect()) {
            $this->makeRequest('GET', $this->response->getTargetUrl());
        }

        return $this;
    }
1159751
public function isRedirect()
    {
        return in_array(
            $this->getStatusCode(),
            [
                StatusCode::HTTP_MOVED_PERMANENTLY,
                StatusCode::HTTP_FOUND,
                StatusCode::HTTP_SEE_OTHER,
                StatusCode::HTTP_TEMPORARY_REDIRECT,
                StatusCode::HTTP_PERMANENT_REDIRECT
            ]
        );
    }