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

I work with Laravel 4,

I check the form using the validator:

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

On failure:

 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, except for several inputs, and not just the password?

I tried Input::except('password','avatar'); but it does not work.

Any help would be greatly appreciated!

+8
php validation laravel laravel-4
source share
2 answers

In fact, I found that I forgot to put Input::old('') to refill the input,

So, the solution is that I tried Input::except('password','avatar');

+8
source share

Try

 Input::except(array('password', 'avatar')); 
+2
source share

All Articles