Added required_with validation rule to conditionally require an attribute based on the presence of another attribute

Signed-off-by: Jason Walton <jwalton512@gmail.com>
This commit is contained in:
Jason Walton
2012-06-11 09:18:42 -07:00
parent 14868a5fd5
commit 6881bdaf02
2 changed files with 25 additions and 1 deletions

View File

@@ -63,6 +63,9 @@ Now you are familiar with the basic usage of the Validator class. You're ready t
'name' => 'required'
#### Validate that an attribute is present, when another attribute is present:
'last_name' => 'required_with:first_name'
<a name="rule-alpha"></a>
### Alpha, Alpha Numeric, & Alpha Dash