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

Posted 1 month 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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.