Laravel6安裝完報錯

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"
    "require": {
        "php": "^7.2",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^1.0",
    },
    "require": {
        "php": "^7.2",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "^6.2",
        "laravel/tinker": "^1.0",
        "symfony/translation-contracts": "^1.1.6",
    },

之後執行命令

composer update
composer dump-autoload

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章