Laravel Redirect

return Redirect::to('foo/bar');
return Redirect::to('foo/bar')->with('key', 'value');
return Redirect::to('foo/bar')->withInput(Input::get());
return Redirect::to('foo/bar')->withInput(Input::except('password'));
return Redirect::to('foo/bar')->withErrors($validator);

Create a new redirect response to the previous location

return Redirect::back();

Create a new redirect response to a named route

return Redirect::route('foobar');
return Redirect::route('foobar', array('value'));
return Redirect::route('foobar', array('key' => 'value'));

Create a new redirect response to a controller action

return Redirect::action('FooController@index');
return Redirect::action('FooController@baz', array('value'));
return Redirect::action('FooController@baz', array('key' => 'value'));

If intended redirect is not defined, defaults to foo/bar.

return Redirect::intended('foo/bar');

Leave a Reply

Your email address will not be published. Required fields are marked *