PHPackages                             weiaibaicai/hupun - 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. [API Development](/categories/api)
4. /
5. weiaibaicai/hupun

ActiveLibrary[API Development](/categories/api)

weiaibaicai/hupun
=================

Laravel的万里牛ERP开放接口的

1.0.3(2y ago)1248[1 issues](https://github.com/weiaibaicai/hupun/issues)MITPHPPHP &gt;=7.1.0

Since Apr 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/weiaibaicai/hupun)[ Packagist](https://packagist.org/packages/weiaibaicai/hupun)[ RSS](/packages/weiaibaicai-hupun/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

laravel hupun
-------------

[](#laravel-hupun)

为 Laravel 提供的万里牛ERP开放接口的 PHP SDK

#### 安装

[](#安装)

第一步：执行 composer 命令下载包 `composer require weiaibaicai/hupun`

第二步：执行 artisan 命令发布配置文件`php artisan vendor:publish --provider="Weiaibaicai\Hupun\HupunServiceProvider"`

第三步：去 .env 添加如下配置

```
# open接口的key
HUPUN_OPEN_KEY=openAppKey
# open接口的秘钥
HUPUN_OPEN_SECRET=open秘钥
# open接口的请求域名
HUPUN_OPEN_URL=https://open-api.hupun.com/api
# open接口的消息通道
HUPUN_OPEN_LOG_CHANNEL=single
# 打印请求结果日志
HUPUN_OPEN_API_IS_LOG_RESULT=1

# b2c接口的key
HUPUN_B2C_KEY=b2cAppKey
# b2c接口的秘钥
HUPUN_B2C_SECRET=b2c秘钥
# b2c接口的请求域名
HUPUN_B2C_URL=https://erp-open.hupun.com/api
# b2c接口的消息通道
HUPUN_B2C_LOG_CHANNEL=single
# 打印请求结果日志
HUPUN_B2C_API_IS_LOG_RESULT=1
```

#### 接口调用

[](#接口调用)

```
use Weiaibaicai\Hupun\Facades\Hupun;
use Weiaibaicai\Hupun\Client;

//调用单笔查询库存的接口
$params = [
    'page'  => 1,
    'limit' => 20,
    'start' => '2023-03-22 00:00:00',
    'end'   => '2023-03-29 00:00:00',
];
//调用的三种方式
dd(Hupun::getInventoriesErp($params));
dd(Client::make()->getInventoriesErp($params));
dd(Client::make()->execute('/inventories/erp', $params, 'get', false));
```

#### b2c签名校验

[](#b2c签名校验)

```
use Weiaibaicai\Hupun\Client;

//取出参数
$params = $request->all();
//验签
$sign = Arr::get($params, 'sign');
unset($params['sign']);
$client = (new Client())->make();
$client->useConfig('b2c');
$newSign = $client->generateSign($params);
if ($newSign === $sign) {
    //todo: 去实现个人业务
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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.

###  Release Activity

Cadence

Every ~15 days

Total

4

Last Release

1082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b17f65f07109c870bff559e1db4df64601d8e1d99542fce6b0b26b5be895f0d?d=identicon)[weiaibaicai](/maintainers/weiaibaicai)

---

Top Contributors

[![weiaibaicai](https://avatars.githubusercontent.com/u/26831491?v=4)](https://github.com/weiaibaicai "weiaibaicai (5 commits)")

---

Tags

apilaravelsdkERPhupunwanliniu

### Embed Badge

![Health badge](/badges/weiaibaicai-hupun/health.svg)

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

###  Alternatives

[leapfu/cloud-printer

高扩展性云小票打印SDK，支持飞鹅云、芯烨云、易联云、快递100、映美云、佳博云、中午云、优声云等主流云打印服务，兼容 Laravel、ThinkPHP 等主流框架，统一API，易集成，易扩展。

104.5k](/packages/leapfu-cloud-printer)

PHPackages © 2026

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