diff --git a/laravel/documentation/validation.md b/laravel/documentation/validation.md index 0f17dec0..1805f32c 100644 --- a/laravel/documentation/validation.md +++ b/laravel/documentation/validation.md @@ -196,14 +196,22 @@ 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-28-05', #### Validate that a date attribute is after a given date: - 'birthdate' => 'after:1986-28-05'; + 'birthdate' => 'after:1986-28-05', > **Note:** The **before** and **after** validation rules use the **strtotime** PHP function to convert your date to something the rule can understand. +#### Validate that a date attribute conforms to a given format: + + 'start_date' => 'date_format:H\\:i'), + +> **Note:** The backslash escapes the colon so that it does not count as a parameter separator. + +The formatting options for the date format are described in the [PHP documentation](http://php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters). + ### E-Mail Addresses