我试图访问我的一个模型中的 created_at 列,但出现以下错误:
The format separator does not match. The format separator does not match. The format separator does not match.
错误实际上重复了 3 次。
这是我尝试访问该列的方式:
$model->created_at
我的模型中没有将 $timestamps 设置为 false,我可以很好地访问其他列。
有什么问题?
最佳答案
您是否覆盖了模型中的 getDateFormat()?
我上周遇到了这个问题。问题是日期时间格式。我有一个解释错误的链接。
https://github.com/laravel/framework/pull/4181
如果您重写了 getDateFormat(),请注释掉该函数并查看它是否有效。
如果不是,请确保数据库中的日期时间格式不古怪。
关于Laravel 4.2 created_at 列给出 "The format separator does not match"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26846440/