7时出现日期错误

7时出现日期错误

本文介绍了升级到Laravel 7时出现日期错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已成功将Laravel实例升级到版本7.到目前为止,除以下错误外,一切似乎还不错.

I have successfully upgraded my Laravel instance to version 7. So far everything seems fine apart from the following error.

我已经遵循了升级文档,并在我的模型中添加了以下内容(但仍然存在相同的问题).

I have followed the upgrade documentation and have added the following to my models (but still having the same problem).

protected function serializeDate(DateTimeInterface $date)
{
    return $date->format('Y-m-d H:i:s');
}

推荐答案

找到了它……迁移似乎并不顺利.

Found it... The migration is not going well it seems.

SO修改composer.json以迁移到laravel 7和symfony 5.然后删除供应商文件夹并重新安装所有内容

SO modify the composer.json to migrate to laravel 7 and symfony 5.Then remove vendor folder and reinstall everything

composer clearcache
composer install

然后它又可以工作了.

这篇关于升级到Laravel 7时出现日期错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 16:06