Hi
Today we will learn, how to use MySQL dates with laravel 5.2.
Starting with MySQL 5.7, 0000-00-00 00:00:00 is no longer considered a valid date, since strict mode is enabled by default. All timestamp columns should receive a valid default value when we insert records into our database. We may use the useCurrent method in our migrations to default the timestamp columns to the current timestamps, or we may make the timestamps nullable to allow null values:
$table->timestamp('foo')->nullable();
$table->timestamp('foo')->useCurrent();
$table->nullableTimestamps();
Thanks
Today we will learn, how to use MySQL dates with laravel 5.2.
Starting with MySQL 5.7, 0000-00-00 00:00:00 is no longer considered a valid date, since strict mode is enabled by default. All timestamp columns should receive a valid default value when we insert records into our database. We may use the useCurrent method in our migrations to default the timestamp columns to the current timestamps, or we may make the timestamps nullable to allow null values:
$table->timestamp('foo')->nullable();
$table->timestamp('foo')->useCurrent();
$table->nullableTimestamps();
Thanks