InvalidArgumentException: A four digit year could not be found
Data missing in carbon/src/Carbon/Carbon.php:425
Getting this error in my apache logs. What is the cause of this type of error?
InvalidArgumentException: A four digit year could not be found
Data missing in carbon/src/Carbon/Carbon.php:425
Getting this error in my apache logs. What is the cause of this type of error?
Running this on the date first should fix it. Likely getting an invalid date from the front-end.
function validateDate($date, $format = 'Y-m-d H:i:s'){
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
I faced and fixed that problem and problem was that I was using the guard method in the eloquent model and then I was trying to save data using create method. Problem was that the array I was providing to create method as a parameter has an extra column apart from the table's column so somehow our created_at or updated_at field was getting disturbed. Once I fixed the extra column issue. The error was removed.