zeroem/curl-bundle
zeroem/curl-bundle is a Symfony bundle that wraps cURL in a simple, configurable HTTP client service. Make GET, POST, and custom requests with headers, options, and error handling, then inject the client anywhere via Symfony's service container.
Install & register. The package is a Symfony 2 bundle, not a Laravel package — there is no service provider and no package auto-discovery. Install it with Composer and, on the Symfony side, register new Zeroem\CurlBundle\ZeroemCurlBundle() in AppKernel. If you are in a Laravel app, the practical entry point is the underlying zeroem/curl library classes (Zeroem\Curl\Curl, the multi-handle manager, and the HttpKernel\CurlClient). You will wire them into the Laravel container yourself rather than relying on bundle services.
Look here first.
Resources/config/services.yml — the canonical list of service ids and their arguments. Everything else in the bundle is composed from these.HttpKernel/CurlClient.php — the HttpKernelInterface implementation. This is the interesting piece: it lets you drive a Request through cURL and get a Response back.curl_multi_* — this is what you will reach for in application code.First use case. Pick one of two:
HttpKernelInterface client is a drop-in for Symfony's Client that goes over the wire with cURL instead of the PHP stream wrapper, so it exercises real sockets, timeouts, and TLS.Batch calls through the curl_multi facade. The natural workflow is: create N Curl handles, add each to the facade, run the multi-exec loop, and reduce the responses. Model this behind a small service (e.g. ApiBatchFetcher) so your app code never touches curl_* functions directly. The facade gives you per-handle completion callbacks, which is the cleanest way to fan results back into typed DTOs.
HttpKernel client as a test harness. Because it implements HttpKernelInterface, you can inject the cURL client wherever Symfony expects an HttpKernel and call handle(Request) — useful for acceptance tests against a staging URL, and for exercising your own controllers over HTTP without booting a full web server. In Laravel, wrap it in a helper trait and use it inside feature tests when $this->get() against the in-process kernel is not faithful enough (e.g. you need real redirects or real TLS).
Handles are the unit of work, not requests. Treat a Curl handle as a reusable, configured request template: set URL/options once, clone per call. This keeps the multi loop simple and avoids re-parsing options each iteration. Store the return value of curl_multi_add_handle so you can pair it with curl_multi_info_read during the exec loop.
Integration tips.
HttpKernel client behind a config flag (services.http.curl_client) so tests can swap in a mock.Http facade — this package earns its place only when you need curl_multi_* semantics or the HttpKernelInterface client.php artisan integration.composer.json constraints before pulling it into a PHP 8 project; you may need to fork or extract the zeroem/curl library alone.curl_multi_remove_handle and curl_close in a finally block. If you return early from the exec loop on a failed handle, unclosed handles accumulate and eventually exhaust file descriptors — the symptom is mysterious CURLE_COULDNT_CONNECT errors under load.CURLOPT_SSL_VERIFYPEER to "fix" connection issues. The bundle exposes standard cURL options; set a CA bundle path instead.CURLOPT_VERBOSE on a single handle and route output to a log, and always inspect curl_errno / curl_error per handle after the multi loop — errors are per-handle, not global, so a silent failure on one request is easy to miss.HttpKernelInterface client is the clean seam: decorate it to add logging or retries without touching the facade. The multi facade is harder to decorate because it drives the loop internally — prefer wrapping it in your own service rather than subclassing.curl_multi, adopting this bundle is cheaper than a rewrite. For new Laravel code, borrow the idea — parallel handles behind a service — and implement it with Guzzle's pool, which is maintained and PSR-compliant.How can I help you explore Laravel packages today?