Friday, July 8, 2016

Laravel 5.2 and MySQL dates

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

2 comments:

  1. Hey! Amazing work. If you are searching for genuine Quickbooks Phone Number dial Quickbooks Customer Service Number 1-855-756-1077 for immediate help.

    ReplyDelete
  2. 888Casino.com - Casino & Hotel Review - JMT Hub
    888Casino.com is located in 성남 출장안마 Curaçao. It 제천 출장안마 is part of the 하남 출장샵 Curacao Gaming Industry 충청북도 출장샵 and part of the Asia-Pacific Region, and is 아산 출장샵 the most  Rating: 4.6 · ‎Review by JT Hub

    ReplyDelete