简体   繁体   中英

Return Input::except() multiple inputs in Laravel 4

I am working with Laravel 4,

I am validating a form with the validator :

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

When it fails :

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
        } 

How can i return inputs excepting multiple inputs, not only the password ?

I've tried Input::except('password','avatar'); but it's not working.

Any help would be greatly appreciated!

Actually, i found that i forget to put the Input::old('') to repopulate the input,

So the solution is exaclty what i've tried Input::except('password','avatar');

尝试

Input::except(array('password', 'avatar'));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM