Why not treat year as an integer (smallint in database) rather than trying to cast it to a date, if that's the only part of the date you're interested in?
Apr 23, 2017
6
Level 1
problems with validation of date in format (yyyy)
hello... i am working in a app, what register car, there ir a field called YEAR, i introduce four digits. with Carbon and the methods GetYEARAttribute and setYEARAttribute I could change it to the year format, use this date field to display it in the views. But in the form I need to validate it with the registration date. In the form I enter four digits corresponding to the year, everything works well .. except the validation. 'YEAR' => 'Before:create_at' ... I think the form does not understand the four digits.. thanks
Please or to participate in this conversation.