当我使用redirect()
时,它不起作用它的工作:
//controller
$v = \Validator::make($request->all(), $this->form_rules);
if ($v->fails()) {
$request->flash();
return view('user.form')->withErrors($v->errors())
->withInput($request->except("password"));
}
//view
{!! Form::email('email', old('email') ) !!}
但我需要使用redirect(),例如:
$v = \Validator::make($request->all(), $this->form_rules);
if ($v->fails()) {
$request->flash();
return redirect('users/create')->withErrors($v->errors())
->withInput($request->except("password"));
}
答案 0 :(得分:0)
尝试改变,
return redirect('users/create')->withErrors($v->errors())
->withInput($request->except("password"));
到
return redirect('user/create')->withErrors($v->errors())
->withInput($request->except("password"));