PHPackages                             sargilla/curl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. sargilla/curl

ActiveLibrary[HTTP &amp; Networking](/categories/http)

sargilla/curl
=============

PHP Curl library for the Laravel 5

012PHP

Since May 30Pushed 10y ago1 watchersCompare

[ Source](https://github.com/sargilla/curl)[ Packagist](https://packagist.org/packages/sargilla/curl)[ RSS](/packages/sargilla-curl/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sargilla/Curl
=============

[](#sargillacurl)

Custom PHP cURL library for the Laravel 5 framework

Installation
------------

[](#installation)

Pull this package in through Composer.

```
    {
        "require": {
            "sargilla/curl": "dev-master"
        }
    }
```

### Laravel 5.\* Integration

[](#laravel-5-integration)

Add the service provider to your `config/app.php` file:

```
    'providers'     => array(

        //...
        Sargilla\Curl\CurlServiceProvider::class,

    ),
```

Add the alias to your `config/app.php` file:

```
    'aliases'       => array(

        //...
        'Curl'          => Sargilla\Curl\Facades\Curl::class,

    ),
```

### Integration without Laravel

[](#integration-without-laravel)

Create a new instance of the `CurlService` where you would like to use the package:

```
    $curlService = new \Sargilla\Curl\CurlService();
```

Usage
-----

[](#usage)

### Laravel usage

[](#laravel-usage)

The package provides an easy interface for sending cURL requests from your application. The package provides a fluent interface similar the Laravel query builder to easily configure the request. There are several utility methods that allow you to easily add certain options to the request.

### Sending GET requests

[](#sending-get-requests)

In order to send a `GET` request, you need to use the `get()` method that is provided by the package:

```
    // Send a GET request to: http://www.foo.com/bar

    // Send a GET request to: http://www.foo.com/bar?foz=baz

    // Send a GET request to: http://www.foo.com/bar?foz=baz using JSON

```

### Sending POST requests

[](#sending-post-requests)

Post requests work similar to `GET` requests, but use the `post()` method instead:

```
    // Send a POST request to: http://www.foo.com/bar

    // Send a POST request to: http://www.foo.com/bar

    // Send a POST request to: http://www.foo.com/bar with arguments 'foz' = 'baz' using JSON

    // Send a POST request to: http://www.foo.com/bar with arguments 'foz' = 'baz' using JSON and return as associative array

```

### Downloading files

[](#downloading-files)

For downloading a file, you can use the `download()` method:

```
    // Download an image from: file http://www.foo.com/bar.png

```

### Usage without Laravel

[](#usage-without-laravel)

Usage without Laravel is identical to usage described previously. The only difference is that you will not be able to use the facades to access the `CurlService`.

```
    $curlService = new \Sargilla\Curl\CurlService();

    // Send a GET request to: http://www.foo.com/bar
    $response = $curlService->to('http://www.foo.com/bar')
        ->get();

    // Send a POST request to: http://www.foo.com/bar
    $response = $curlService->to('http://www.foo.com/bar')
        ->post();
```

License
-------

[](#license)

This template is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

Contact
-------

[](#contact)

Santiago Argilla (developer)

- Email:

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/da8e2a69f7c9ddb844e33fd89a9e9be3039303688c90af5ce498b0ec4dddd9cb?d=identicon)[sargilla](/maintainers/sargilla)

---

Top Contributors

[![sargilla](https://avatars.githubusercontent.com/u/263582?v=4)](https://github.com/sargilla "sargilla (6 commits)")

### Embed Badge

![Health badge](/badges/sargilla-curl/health.svg)

```
[![Health](https://phpackages.com/badges/sargilla-curl/health.svg)](https://phpackages.com/packages/sargilla-curl)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M81](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.7k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M89](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
