How can I require composer autoloader in the laravel?

微笑、不失礼 提交于 2019-12-02 03:46:02

问题


I want to install guzzle https://github.com/guzzle/guzzle

I read the reference, but I'm confused this section :

From that tutorial, asking for require composer autoloader. So seems needed to add require 'vendor/autoload.php'; Where I add the script?

I using laravel 5.6


回答1:


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.

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.



来源:https://stackoverflow.com/questions/52091827/how-can-i-require-composer-autoloader-in-the-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!