在Laravel 4中返回Input :: except()多个输入

Oba*_*ama 8 php validation laravel laravel-4

我正在与Laravel 4合作,

我正在使用验证器验证表单:

$validator = Validator::make(Input::all(), $rules);

失败时:

if ($validator->fails()) {
            return Redirect::to('register/test')
                            ->withErrors($validator)
                            ->withInput(Input::except('password')); // send back the input so that we can repopulate the form
        } 
Run Code Online (Sandbox Code Playgroud)

除了多个输入外,我怎样才能返回输入,而不仅仅是密码?

我试过了,Input::except('password','avatar');但它不起作用.

任何帮助将不胜感激!

Oba*_*ama 8

实际上,我发现我忘记了Input::old('')重新填充输入,

因此,我所尝试的解决方案非常简单 Input::except('password','avatar');