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 2mo 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 10% 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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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