From f313168d4b53b32b1ee3ce3e2e9ed749848f6985 Mon Sep 17 00:00:00 2001 From: Asko Nomm Date: Sun, 6 Mar 2022 22:48:02 +0100 Subject: (MINOR) Implement DateFormatValidator --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 0be14fa..d60b44b 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,18 @@ $rules = ['password' => 'required']; $hird = new Hird($fields, $rules); ``` +### 'date-format` + +The `date-format` validator validates the string format of a date, and is registered as the `date-format` rule. It will pass validation if the value is set and the value is in the format specified by the rule. + +```php +use Askonomm\Hird\Hird; + +$fields = ['date' => '2020-09-17']; +$rules = ['date' => 'date-format:Y-m-d']; +$hird = new Hird($fields, $rules); +``` + ## Creating validators You can also create your own validators, or replace existing ones if you're not happy with them. -- cgit v1.2.3