Level 51
Have you installed guzzle?
composer require guzzlehttp/guzzle:~6.0
Make sure you run composer dumpautoload if you are still getting the error
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I try to do a http request wit guzzle using this code
class FeedbackController extends Controller
{
/**
* API Endpoint
*
* @var string
*/
private $endpoint = 'https://gitlab.com/api/v4/projects/[id]';
/**
* Client for Requests
*
* @var GuzzleHttp/Client
*/
protected $client;
/**
* Creates a new Controller Instance
*
* @return void
*/
public function __construct()
{
$this->middleware('app');
$this->client = new Client([
'base_uri' => $this->endpoint,
'headers' => ['PRIVATE-TOKEN' => 'xxx'],
]);
}
public function getLabels()
{
$result = $this->client->request('GET', '/labels');
return $result;
}
}
If I run the method getLabels I get this error
Class 'Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory' not found
I've already the "symfony/psr-http-message-bridge": "^1.1" in my composer.json.
What is the problem with this request?
Please or to participate in this conversation.