Validator
Validator copied to clipboard
Some rules always fail if not set in data
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.
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!