From 2e3271ff54a2f161c9924f926e68ec5dc15857d8 Mon Sep 17 00:00:00 2001 From: Asko Nomm Date: Sun, 27 Feb 2022 19:54:19 +0100 Subject: Make `validate` fn also be aware of the `$field`. This enables the creation of more complex validators, such as `unique:posts` where the `$field` might be used to determine a column in the `posts` table. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index ed92dfc..fc3e78f 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ class EmailValidator implements Validator * @param mixed $modifier * @return boolean */ - public static function validate(mixed $value, mixed $modifier = null): bool + public static function validate(string $field, mixed $value, mixed $modifier = null): bool { return filter_var($value, FILTER_VALIDATE_EMAIL); } -- cgit v1.2.3