PHPackages                             weikaiii/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. weikaiii/curl

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

weikaiii/curl
=============

curl support in laravel

06PHP

Since Apr 13Pushed 8y agoCompare

[ Source](https://github.com/weikaiiii/Curl)[ Packagist](https://packagist.org/packages/weikaiii/curl)[ RSS](/packages/weikaiii-curl/feed)WikiDiscussions master Synced 3mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

weikaiii-curl
=============

[](#weikaiii-curl)

方便curl使用，支持链式操作，简化curl常用操作

版本要求
====

[](#版本要求)

PHP 5.3 +

Laravel/Lumen &gt;= 5.1

Composer

安装
==

[](#安装)

```
composer require weikaiii/curl dev-master
```

配置
==

[](#配置)

### Laravel 应用

[](#laravel-应用)

1. 在 `config/app.php` 注册 ServiceProvider 和 Facade (Laravel 5.5 无需手动注册)

```
'providers' => [
    // ...
     Weikaiii\Curl\CurlServiceProvider::class,
],
'aliases' => [
    // ...
   'Curl' => Weikaiii\Curl\CurlClass::class,
],

```

使用
==

[](#使用)

\#####GET:

```
$content = Curl::init()->url(目标url)->get(数组参数);
```

##### POST:

[](#post)

```
Curl::init()->url(目标url)->post(数组参数);
```

##### 保存生成的选项：

[](#保存生成的选项)

```
Curl::init()->url(目标url)->header($header)->cookie($cookie)->save();

下面可以直接用 保持上面的请求头和cookie
Curl::init()->post($data);

Curl::init()->file('img.jpg')->post();
```

##### 设置参数

[](#设置参数)

```
Curl::init()->set('CURLOPT_选项', 值)->url(目标url);
```

\#####设置超时60秒

```
Curl::init()->time('60')->url(目标url);

```

##### 设置证书

[](#设置证书)

```
Curl::init()->cacert('证书文件路径')->url(目标url);

```

##### 设置cookie

[](#设置cookie)

```
Curl::init()->cookie($cookie)->url(目标url);

```

##### 设置header

[](#设置header)

```
Curl::init()->header($header)->url(目标url);

```

##### 设置language

[](#设置language)

```
Curl::init()->language($language)->url(目标url);

```

##### 设置agent

[](#设置agent)

```
Curl::init()->agent($agent)->url(目标url);

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

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/f40052c6a2120cfd79e19ee61cc32aaf43252072be9d85caa6b25c83506eda19?d=identicon)[weikaiii](/maintainers/weikaiii)

---

Top Contributors

[![kayw-geek](https://avatars.githubusercontent.com/u/29700073?v=4)](https://github.com/kayw-geek "kayw-geek (3 commits)")

---

Tags

curlcurl-functionscurl-installcurl-librarycurlphp

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

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

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/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

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

PHPackages © 2026

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