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

11,774

Solution 1

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

Solution 2

Try

Input::except(array('password', 'avatar'));
Share:
11,774
Obama
Author by

Obama

Entrepreneur, Software & Web Developer, Web Administrator, Former Hacker ~~ when Chuck Norris needs a developer, he calls me!

Updated on July 24, 2022

Comments

  • Obama
    Obama almost 2 years

    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!