diff --git a/README.md b/README.md index c8d0a79..15ff9f5 100644 --- a/README.md +++ b/README.md @@ -463,6 +463,7 @@ Just after registering the SupportServiceProvider, the following new custom vali - alpha_underscore : The following characters are allowed: letters, numbers and underscores - alpha_names : The following characters are allowed: letters, menus, apostrophes, underscores and spaces - alphanumeric_names : The following characters are allowed: letters, numbers, menus, apostrophes, underscores and spaces +- alphanumeric_dotted_names : The following characters are allowed: letters, numbers, menus, apostrophes, underscores, dots and spaces ## Custom Exceptions diff --git a/src/MicheleAngioni/Support/CustomValidators.php b/src/MicheleAngioni/Support/CustomValidators.php index 8caa396..4995e36 100644 --- a/src/MicheleAngioni/Support/CustomValidators.php +++ b/src/MicheleAngioni/Support/CustomValidators.php @@ -52,6 +52,18 @@ public function validateAlphanumericNames($attribute, $value) return preg_match('/^([-\p{L}0-9\'_\s])+$/u', $value); } + /** + * alphanumeric_dotted_names permits the following UNICODE characters: letters, numbers, menus, apostrophes, underscores, dots and spaces + * + * @param $attribute + * @param $value + * @return int + */ + public function validateAlphanumericDottedNames($attribute, $value) + { + return preg_match('/^([-\p{L}0-9.\'_\s])+$/u', $value); + } + /** * alpha_names permits the following UNICODE characters: letters, menus, apostrophes, underscores and spaces *