Controller redirect back to a POST form Controller redirect back to a POST form laravel laravel

Controller redirect back to a POST form


You can use Redirect::back()->withInput();

You may wish to redirect the user to their previous location, for example, after a form submission. You can do so by using the back method

See: http://laravel.com/docs/5.0/responses


You don't need to use POST to go to the edit page. You can use GET and a parameter to the route, check this out: http://laravel.com/docs/routing#route-parameters

You'd have a GET route to show the edit page, and a POST route to handle the request when the user submits the form.

It'll look like this (notice the parameters):

public function getEdit($id){    return View::make(....);}public function postEdit($id){    ...    return Redirect::back()->withErrors($validator)->withInput();}


if "redirect with POST" is exist, then I don't know it. I recomend you to just use flash data

Redirect::to('user/login')->with('id', 'something');