Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 523
Obama Avatar asked Mar 08 '14 17:03

Obama


1 Answers

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');

like image 117
Obama Avatar answered Oct 20 '22 12:10

Obama