Skip to content

Conversation

rishi111-code
Copy link

What
Adds Validator::isUrl(int $flags = 0) and Validator::isEmail() to the fluent validation API.

Why
Many projects keep APP_URL, webhook endpoints, and support emails in .env. Validating these early prevents misconfiguration and runtime failures. Complements existing validators (isInteger(), isBoolean(), allowedValues()) described in the README. GitHub

How
Uses filter_var(..., FILTER_VALIDATE_URL|EMAIL) for correctness and maintainability; supports optional URL flags (e.g., FILTER_FLAG_PATH_REQUIRED). Honors required() vs ifPresent() semantics.

Tests
Added unit tests for pass/fail cases and ifPresent() interplay.

Docs
README: small usage snippet in Validation section.

BC breaks
None.

What
Adds Validator::isUrl(int $flags = 0) and Validator::isEmail() to the fluent validation API.

Why
Many projects keep APP_URL, webhook endpoints, and support emails in .env. Validating these early prevents misconfiguration and runtime failures. Complements existing validators (isInteger(), isBoolean(), allowedValues()) described in the README.
GitHub

How
Uses filter_var(..., FILTER_VALIDATE_URL|EMAIL) for correctness and maintainability; supports optional URL flags (e.g., FILTER_FLAG_PATH_REQUIRED). Honors required() vs ifPresent() semantics.

Tests
Added unit tests for pass/fail cases and ifPresent() interplay.

Docs
README: small usage snippet in Validation section.

BC breaks
None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant