You have to use datetime in a migration instead of timestamp
Docs: https://laravel.com/docs/8.x/migrations#column-method-dateTime
The TIMESTAMP data type can hold values between '1970-01-01 00:00:01' (UTC) and '2038-01-19 03:14:07' (UTC).
May Sale! All accounts are 40% off this week.
So I have some pretty-nasty old PHP code I'm trying to port to Laravel. Its got a lot of direct mysql queries and quite a lot expect default dates of '0000-00-00' in certain date fields.
Now I'm using mysql 5.6 in dev and even in production, I am able to set the flag to allow this type of date.
My migration file (created with a tool from exiisting database) is however throwing an error about this date, even though the underlying database doesn't mind it.
Is there a flag I can use to Laravel accept it and run migrations as expected?
ok, setting strict to false in database.php solved it!
Please or to participate in this conversation.