dvelopment/curl
dvelopment/curl is a lightweight PHP wrapper around cURL for making HTTP requests with a simpler API. Provides helpers for common request types, headers, query params, and response handling, suitable for quick integrations and small services.
curl_* functions, reducing boilerplate and improving readability.Curl::get()).curl extension (enabled by default in most Laravel deployments).Mockery or Laravel’s MockHttpClient (if wrapped in a service layer).CURLOPT_* options.config/app.php and bind it to the container.
$this->app->singleton('curl', function ($app) {
return new \dVelopment\Curl\Client(config('services.api.timeout'));
});
config/app.php for global access (e.g., Curl::post()).ApiClientService) and abstract away package-specific details.HttpClient (Symfony) or Guzzle.Http::macro() system may reduce the need for a wrapper.curl_* calls in the codebase with the wrapper.curl_* usage via static analysis (e.g., PHPStan).HttpRequestSent, HttpResponseReceived) via Laravel’s event system.Cache::remember()).CURLOPT_FOLLOWLOCATION behavior matches expectations.CURLOPT_SSL_VERIFYPEER is configured securely (default may be unsafe).composer require dvelopment/curl.config/services.php.curl_* calls with the wrapper’s methods (e.g., Curl::get()).Http::fake() or mocking.tap or middleware).withHeaders() for auth tokens").Curl::get('https://api.example.com')->tap(function ($response) {
\Log::debug('API Response', ['status' => $response->status, 'body' => $response->body]);
});
CurlException or HTTP errors (e.g., 4xx/5xx).CURLOPT_FORBID_REUSE and CURLOPT_FRESH_CONNECT carefully.curl handles.CURLOPT_CAINFO explicitly.How can I help you explore Laravel packages today?