Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
您将需要数据库中的Updated_at列,在迁移中添加此列:
$ table-> timestamps();
然后重新运行迁移
You will require updated_at column in your Database, add this in migration :
$table->timestamps();
then re run the migration
如果要保存create_at和updated_at,则必须在迁移中设置此或手动添加。
您的迁移一定是这样的:
否则,无论何时创建/更新记录,您都必须在型号的顶部设置关注行(使用之后之后命令):
If you want to save created_at and updated_at, you must to set this in you migration or add the manually.
Your migration must be soething like this:
Otherwise when it's no matter when your record is created/updated, you have to set following line at the top of your Model (after use command):