Null timestamp in database – Carbon

I have a problem with the storage of zero date in the MySql database in the field of type timestamp. To read this field I use the Carbon library. When the value in database is equal 0000-00-00 00-00-00 Carbon converts it into a -0001-11-30 0:00:00. When saving to use a NULL value for the timestamp field. If I check if a date field is empty I must compare it to -0001-11-30 0:00:00. How can I solve this problem? Thank You!


Source: laravel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.