How to only use created_at in Laravel

后端 未结 17 2091
自闭症患者
自闭症患者 2020-12-07 18:20

I want only use created_at , how to do it?

I know:

This can custom timestamps name

const CREATED_AT = \'created\';
const UPDATED_AT = \'updat         


        
17条回答
  •  日久生厌
    2020-12-07 18:55

    In Laravel 5.7, this was enough for me to have it work:

    In migration:

    $table->timestamp('created_at')->nullable();
    

    instead of classic $table->timestamp('created_at');

    In model:

    const UPDATED_AT = null;
    

提交回复
热议问题