Laravel Class 'Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory' not found

Posted 3 months ago by markusheinemann

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 sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.