Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我应该使用 DATETEIME 吗?还是INT?
谢谢!
编辑:我专门针对
public static $timestamps = true;
在 Eloquent 模型中设置的标志。
Laravel 只支持datetime他们的时间戳。
datetime
https://github.com/laravel/laravel/pull/769
就像更新一样:Mich 的答案对 Laravel 3 及以下版本仍然有效,
但从 Laravel 4 开始,它切换到和的支撑timestamp柱。created_atupdated_at
timestamp
created_at
updated_at
这是 GitHub 上的一个相关问题
Laravel 5 默认是 TIMESTAMP