Symfony\Component\Debug\Exception\FatalErrorException

Laravel6构建项目报错

Symfony\Component\Debug\Exception\FatalErrorException
Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be 
compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)

解决办法
在项目目录修改composer.json文件
增加如下代码
"symfony/translation-contracts": "^1.1.6"

Symfony\Component\Debug\Exception\FatalErrorException_第1张图片
保存退出执行下面命令

composer update
composer dump-autoload

你可能感兴趣的:(laravel)