I am trying to enable guzzle http client from a vendor folder and using composer. Here is what I have tried so far.
File Location http: http: vendor/guzzle/guzzle/src/Guzzle/Http/Client.php
In composer.json I included
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"files":["vendor/guzzle/guzzle/src/Guzzle/Http/Client.php"],
"psr-4": {
"App\\": "app/"
}
},
I executed the command composer dumpautoload
.
In my controller, I am trying to call an api endpoint like this
use GuzzleHttp\Client;
$client = new Client();
$res = $client->get('https://api.fixer.io/latest?symbols=CZK,EURO');
Error Class 'GuzzleHttp\Client' not found
What am I missing here, please help me. Thank you
For a better file structure, here is a screenshot of the file location

sadek source
share