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('');


Yes, it’s

use Illuminate\Support\Facades\Redirect;

return Redirect::to('');

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);

Answered By – The Alpha

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published