Skip to content

documentation fix on validators #1357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions laravel/documentation/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ Many times, when updating a record, you want to use the unique rule, but exclude

#### Validate that a date attribute is before a given date:

'birthdate' => 'before:1986-28-05';
'birthdate' => 'before:1986-05-28';

#### Validate that a date attribute is after a given date:

'birthdate' => 'after:1986-28-05';
'birthdate' => 'after:1986-05-28';

> **Note:** The **before** and **after** validation rules use the **strtotime** PHP function to convert your date to something the rule can understand.

Expand Down Expand Up @@ -450,4 +450,4 @@ Next, let's take our "awesome" rule and define it in our new class:

Notice that the method is named using the **validate_rule** naming convention. The rule is named "awesome" so the method must be named "validate_awesome". This is one way in which registering your custom rules and extending the Validator class are different. Validator classes simply need to return true or false. That's it!

Keep in mind that you'll still need to create a custom message for any validation rules that you create. The method for doing so is the same no matter how you define your rule!
Keep in mind that you'll still need to create a custom message for any validation rules that you create. The method for doing so is the same no matter how you define your rule!