Add new 'required_without' validation rule #824

Merged
merged 2 commits into from Apr 4, 2013

Conversation

Projects
None yet
2 participants
Contributor

andershammar commented Apr 3, 2013

Add new 'required_without' validation rule that verifies that the field under validation must be present only if the other specified fields are not present.

This is the opposite of the 'required_with' validation rule. It makes sense to have a rule like this since we already have the 'same' and 'different' validation rules which are each other's counterparts. I also need a rule like this for a personal project that I am working on. :-)

Add 'required_without' validation rule
The field under validation must be present only if the other
specified fields are not present.
Contributor

andershammar commented Apr 3, 2013

Seems like the Travis job that runs for PHP 5.3 failed because Composer could not download the ClassPreloader repository.

Owner

taylorotwell commented Apr 4, 2013

Would you mind contributing unit tests for the rules?

Contributor

andershammar commented Apr 4, 2013

Added tests for the new validation rule.

My editor was set to trim trailing white space on save so the commit modified a couple of extra rows. Sorry about that.

taylorotwell added a commit that referenced this pull request Apr 4, 2013

Merge pull request #824 from andershammar/master
Add new 'required_without' validation rule

@taylorotwell taylorotwell merged commit faae037 into laravel:master Apr 4, 2013

1 check failed

default The Travis build could not complete due to an error
Details
Owner

taylorotwell commented Apr 4, 2013

Pretty thorough tests, thanks!

Contributor

andershammar commented Apr 4, 2013

Thanks for merging the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment