phplaravel

Redirect to a given Laravel URL


Is there a method in Redirect class of laravel where the parameter is a complete url? We all know parameters to these methods are just route name,action, slash,..etc but what I want now is like

return Redirect::foo('https://bla.com/?yken=KuQxIVTNRctA69VAL6lYMRo0');

Solution

  • Yes, it's

    use Illuminate\Support\Facades\Redirect;
    
    return Redirect::to('https://heera.it');
    

    Check the documentation.

    Update: Redirect::away('url') (For external link, Laravel Version 4.19):

    public function away($path, $status = 302, $headers = array())
    {
        return $this->createRedirect($path, $status, $headers);
    }