且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何在Laravel中要求作曲家自动加载器?

更新时间:2023-11-17 10:51:28

如果要在Laravel中安装枪口,则无需执行任何操作. 上面的示例实际上是针对核心php的. Laravel会自动为您完成此操作.

You don't have to do anything if you are going to install guzzle in Laravel. The example above is for core php actually. Laravel will automatically do it for you.

只需在终端中运行composer require guzzlehttp/guzzle. (当然,在您的laravel项目实际所在的目录中.)
并在要从中调用guzzle的文件的顶部添加use GuzzleHttp\Client;.

Just run composer require guzzlehttp/guzzle in your terminal. (of course in the directory where your laravel project actually is.)
And add use GuzzleHttp\Client; at the top of the file you will be calling guzzle from.