How to redirect back to form with input - Laravel 5

后端 未结 9 1209
离开以前
离开以前 2020-12-01 02:53

How do I redirect back to my form page, with the given POST params, if my form action throws an exception?

9条回答
  •  囚心锁ツ
    2020-12-01 03:09

    You can use any of these two:

    return redirect()->back()->withInput(Input::all())->with('message', 'Some message');

    Or,

    return redirect('url_goes_here')->withInput(Input::all())->with('message', 'Some message');

提交回复
热议问题