Laravel: 类 'GuzzleHttp\Client' 未找到
2022-08-30 13:39:55
我正在尝试使用Mandrill通过我的Laravel框架发送电子邮件,但是我收到以下错误:
MandrillTransport 中的 FatalErrorException.php第 114 行:找不到类 'GuzzleHttp\Client'
我已经在终端中使用以下命令安装了Guzzle:
"guzzlehttp/guzzle": "~4.0"
根据Laravel的文档,我需要添加到我的composer.json文件中,但我不确定我放置它的位置是否正确,因为我仍然看到错误。"guzzlehttp/guzzle": "~4.0"
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "5.0.*",
"illuminate/html": "^5.0",
"guzzlehttp/guzzle": "~4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php -r \"copy('.env.example', '.env');\"",
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
这是我的应用程序具有的软件包列表,请注意guzzle具有不同的版本:4.2.3,我也尝试过更新,但仍然得到相同的错误。