我的项目突然出现了以下错误:
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下面是包中代码的一小部分:
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
我有个错误:
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].我不知道我能做些什么
请帮我解决这个问题,谢谢!
发布于 2020-12-06 21:56:17
我在Laravel 7上也有同样的错误,使用Vonage。在这里度过了一个晚上。对于我来说,在.env中设置了以下内容:
NEXMO_HTTP_CLIENT="Http\\Adapter\\Guzzle6\\Client"如果您没有更改config/connecmo.php,则直接使用它。
不确定这是否是最好的解决方案,但我正在寻找那个ClientInterface,并找到了这个Guzzle6 6/Client
https://stackoverflow.com/questions/65039722
复制相似问题