spatie / laravel-validation-rules

A set of useful Laravel validation rules

Home Page:https://spatie.be/open-source

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] What is the idea behind accepting `0` as a nullable value for CountryCode?

imdhemy opened this issue · comments

commented

IMO, accepting 0 as a nullable value for the CountryCode is a bit confusing. If the user submitted 0 as a country code, and the developer retrieved the validated values from the request, they would expect to get null as the value for the country code, but they would get 0 instead.

  • Maybe there is a good reason for this, can you explain it?
  • Another question, should an empty string be considered a nullable value for the CountryCode?

I was about to create a PR to fix this, but I wanted to ask first.