首页 > Laravel中自动维护的created_at和updated_at字段的字段类型应该是什么?

Laravel中自动维护的created_at和updated_at字段的字段类型应该是什么?

Timestamp?Int?


http://www.golaravel.com/laravel/docs/5.0/eloquent/#timestamps


laravel框架中默认的ORM模型created_at,updated_at字段的数据类型是datetime
也可以改为int

public function fromDateTime($value){
        return strtotime(parent::fromDateTime($value));
    }
【热门文章】
【热门文章】