在 Laravel 5 中为 Mailgun 添加 Guzzle

Adding Guzzle For Mailgun in Laravel 5

我想在Laravel 5中使用Mailgun服务。这需要安装 Guzzle 5。我已将以下内容添加到 composer.json,并安装了它:

"guzzlehttp/guzzle": "~5.0"

但是,我的应用程序给我这个错误:

MailgunTransport.php 第 121 行中的 FatalErrorException: Class 'GuzzleHttp\Client' 未找到

我已经 运行 composer dump-autoload。我错过了什么?谢谢

我使用以下方法解决了这个问题:

    "laravel/framework": "5.0.16",
    "guzzlehttp/guzzle": "5.2",

作曲家更新

仅此而已。

composer install 安装 composer.lock 中列出的软件包(包括确切版本)。添加新包或更改版本要求时,您需要 composer update(或者您可以使用 composer require),因为新包尚未在锁定文件中。

运行 composer installcomposer.json 自上次更新后 update/require 应该生成一条警告说 Warning: The lock file is not up to date with the latest changes in composer.json, you may be getting outdated dependencies, run update to update them.