I am migrating a site from codeigniter to Laravel.
对于遗产表reports
,一些现有列created_at
和updated_at
分别被命名为date_created
和date_modified
.
I wish to tell my eloquent Report
model about these custom timestamp column names.
本文档仅提供关闭时间戳或提供自定义时间戳格式的参考.
I am migrating a site from codeigniter to Laravel.
对于遗产表reports
,一些现有列created_at
和updated_at
分别被命名为date_created
和date_modified
.
I wish to tell my eloquent Report
model about these custom timestamp column names.
本文档仅提供关闭时间戳或提供自定义时间戳格式的参考.
在模型中,可以定义这样的常量来更改列名
class BaseModel extends Eloquent {
const CREATED_AT = 'date_created';
const UPDATED_AT = 'date_modified';
}
or use you can use something like this Managing Timestamps