Php 为什么我能';不要使用Composer将Guzzle导入我的Laravel项目?

Php 为什么我能';不要使用Composer将Guzzle导入我的Laravel项目?,php,laravel,laravel-5,composer-php,guzzle,Php,Laravel,Laravel 5,Composer Php,Guzzle,我对PHP和Laravel非常陌生,我发现在尝试添加Guzzle库时遇到了一些困难(我可以用PHP俚语称之为库,我来自Java…) 所以我遵循了这篇文章的建议: 我已将此依赖项添加到我的composer.json文件中:“guzzle/guzzle”:“*” 我已将其添加到原始文件的此部分(由Laravel生成): 我不知道这是不是正确的位置 然后我在shell中执行了composer更新语句(从项目的根目录),并获得以下输出: Andrea@Andrea-PC MINGW64 ~/Docume

我对PHPLaravel非常陌生,我发现在尝试添加Guzzle库时遇到了一些困难(我可以用PHP俚语称之为库,我来自Java…)

所以我遵循了这篇文章的建议:

我已将此依赖项添加到我的composer.json文件中:“guzzle/guzzle”:“*”

我已将其添加到原始文件的此部分(由Laravel生成):

我不知道这是不是正确的位置

然后我在shell中执行了composer更新语句(从项目的根目录),并获得以下输出:

Andrea@Andrea-PC MINGW64 ~/Documents/Betrivius/WorkSpace/betriviusExtranet (master)
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package guzzle/guzzle is abandoned, you should avoid using it. Use guzzlehttp/guzzle instead.
Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize
Generating optimized class loader
The compiled class file has been removed.
我没有看到任何错误,因此我认为它已成功完成

问题是我无法在我的项目中找到这些依赖项,在类定义之前,我尝试使用它:

use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Client;
我获得以下错误消息:

Undefine namespace
Referenced namespace is not found
在特定的示例中,我获得了关于这4个红色名称空间的错误消息:

为什么??怎么了?我错过了什么?如何解决此问题

guzzle/guzzle已被放弃,您应该避免使用它。改用guzzle http/guzzle


使用guzzle http/guzzle

如上所述,您应该使用
guzzle http/guzzle
,而不是
guzzle/guzzle


如果你真的需要使用
guzzle/guzzle
,你可以通过
guzzle
名称空间导入它,而不是
GuzzleHttp
,它是为新版本保留的。

>如果放弃了包guzzle/guzzle,你应该避免使用它。改用guzzle http/guzzle。
Undefine namespace
Referenced namespace is not found