From 91b236be629d6740490e5df1581c16ae753bed1a Mon Sep 17 00:00:00 2001 From: Peter Fox Date: Sat, 19 Jul 2025 22:01:11 +0100 Subject: [PATCH 1/3] Adds strict param for numeric rule --- validation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/validation.md b/validation.md index 6f982d65c8..0899969ec3 100644 --- a/validation.md +++ b/validation.md @@ -1968,6 +1968,12 @@ The field under validation may be `null`. The field under validation must be [numeric](https://www.php.net/manual/en/function.is-numeric.php). +You may use the `strict` parameter to only consider the field valid if its value is an int or float type and to invalidate numeric strings: + +```php +'foo' => 'numeric:strict' +``` + #### present From 136d69a1222ab25da45656fd5eb5368d6257c99a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 20 Jul 2025 13:32:27 -0500 Subject: [PATCH 2/3] Update validation.md --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index 0899969ec3..dbf3888c87 100644 --- a/validation.md +++ b/validation.md @@ -1968,7 +1968,7 @@ The field under validation may be `null`. The field under validation must be [numeric](https://www.php.net/manual/en/function.is-numeric.php). -You may use the `strict` parameter to only consider the field valid if its value is an int or float type and to invalidate numeric strings: +You may use the `strict` parameter to only consider the field valid if its value is an integer or float type. Numeric strings will be considered invalid: ```php 'foo' => 'numeric:strict' From 7cfc42046aa50de7f50769f30e2f188a142c19c0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 20 Jul 2025 13:32:57 -0500 Subject: [PATCH 3/3] Update validation.md --- validation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation.md b/validation.md index dbf3888c87..53cdb140f9 100644 --- a/validation.md +++ b/validation.md @@ -1971,7 +1971,7 @@ The field under validation must be [numeric](https://www.php.net/manual/en/funct You may use the `strict` parameter to only consider the field valid if its value is an integer or float type. Numeric strings will be considered invalid: ```php -'foo' => 'numeric:strict' +'amount' => 'numeric:strict' ```