Validating a custom date format in with laravel validator
In my app, the user selects date from a datepicker and the date is then displayed in the input in a format that corresponds user’s locale.
When the form is submitted, I would like to validate the respective date, however, the validator does not know the date format that the date was submitted in.
My question is whether I should mutate the date into Y-m-d before it is passed to validator or is there a way I can tell the Validator the right format to validate in?
from Laravel Questions and Answers https://laravelquestions.com/php/validating-a-custom-date-format-in-with-laravel-validator/
via Lzo Media
No comments:
Post a Comment