首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GuzzleHttp突然给了我一个关于Laravel的错误

GuzzleHttp突然给了我一个关于Laravel的错误
EN

Stack Overflow用户
提问于 2020-11-27 15:20:19
回答 1查看 1.2K关注 0票数 1

我的项目突然出现了以下错误:

代码语言:javascript
复制
Argument 1 passed to Vonage\Client::setHttpClient() must be an instance of Psr\Http\Client\ClientInterface, instance of GuzzleHttp\Client given, called in /home/vagrant/Code/xxx/vendor/nexmo/client-core/src/Client.php

下面是包中代码的一小部分:

代码语言:javascript
复制
        if (is_null($client)) {
        // Since the user did not pass a client, try and make a client
        // using the Guzzle 6 adapter or Guzzle 7 (depending on availability)
        /** @noinspection ClassConstantCanBeUsedInspection */
        if (class_exists('\GuzzleHttp\Client')) {
            $client = new \GuzzleHttp\Client();
        } elseif (class_exists('\Http\Adapter\Guzzle6\Client')) {
            /** @noinspection CallableParameterUseCaseInTypeContextInspection */
            /** @noinspection PhpUndefinedNamespaceInspection */
            /** @noinspection PhpUndefinedClassInspection */
            $client = new \Http\Adapter\Guzzle6\Client();
        }
    }

    $this->setHttpClient($client);

我尝试用:composer require /guzzle更新guzzlehttp

我有个错误:

代码语言:javascript
复制
  Problem 1
    - webup/laravel-sendinblue v2.0.3 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - webup/laravel-sendinblue v2.0.3 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - webup/laravel-sendinblue v2.0.3 requires guzzlehttp/guzzle ^6.3 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
    - Can only install one of: guzzlehttp/guzzle[7.2.0, 6.5.x-dev].
    - Installation request for guzzlehttp/guzzle ^7.2 -> satisfiable by guzzlehttp/guzzle[7.2.0].
    - Installation request for webup/laravel-sendinblue (locked at v2.0.3, required as 2.*) -> satisfiable by webup/laravel-sendinblue[v2.0.3].

我不知道我能做些什么

请帮我解决这个问题,谢谢!

EN

回答 1

Stack Overflow用户

发布于 2020-12-06 21:56:17

我在Laravel 7上也有同样的错误,使用Vonage。在这里度过了一个晚上。对于我来说,在.env中设置了以下内容:

代码语言:javascript
复制
NEXMO_HTTP_CLIENT="Http\\Adapter\\Guzzle6\\Client"

如果您没有更改config/connecmo.php,则直接使用它。

不确定这是否是最好的解决方案,但我正在寻找那个ClientInterface,并找到了这个Guzzle6 6/Client

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65039722

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档