Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some rules always fail if not set in data #50

Open
jkuchynka opened this issue Feb 6, 2024 · 1 comment
Open

Some rules always fail if not set in data #50

jkuchynka opened this issue Feb 6, 2024 · 1 comment

Comments

@jkuchynka
Copy link

If a rule is not present, required, etc... it should not fail if it's not set in data. FYI, this works as expected for some rules, such as string, array, boolean

There are a lot of rules I've found this problem with such as: integer, date and url, and lots more.

I can submit a PR if anyone else sees this as a valid issue.

@rkaw92
Copy link

rkaw92 commented Jul 4, 2024

Hi, if you're here because you're using Validator and finding that it doesn't quite match Laravel's behavior, you're not alone.

Luckily, you can use this totally undocumented feature (that doesn't exist in Laravel's validator AFAIK):

nullable|url

Hope it helps somebody else!

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

No branches or pull requests

2 participants