How to only use created_at in Laravel

后端 未结 17 2113
自闭症患者
自闭症患者 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 19:02

    You can use CURRENT_TIMESTAMP default value for created field in your MySQL table and set

    public $timestamps = false;
    

    in your model.

提交回复
热议问题