PHPackages                             lmh/esign - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lmh/esign

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lmh/esign
=========

根据e签宝官方文档开发的一个 PHP 扩展包.

1.2(4y ago)12MITPHPPHP &gt;=7.1.0

Since Jun 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lmhfq/esign)[ Packagist](https://packagist.org/packages/lmh/esign)[ RSS](/packages/lmh-esign/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

安装
--

[](#安装)

```
$ composer require lmh/esign:dev-master -vvv
```

使用
--

[](#使用)

```
// 配置信息
$config = [
   'debug' => true, // 是否开启调试
   'app_id' => "****", // 请替换成自己的 AppId
   'secret' => '****', // 请替换成自己的 Secret
   'production' => false, // 是否正式环境

   'log' => [
       'level'      => 'debug',
       'permission' => 0777,
       'file'       => '/tmp/esign.log', // 开启调试时有效, 可指定日志文件地址
   ],
];

$eSign = new \Lmh\ESign\Application($config);

$thirdPartyUserId = 'your_party_user_id'; // 用户唯一标识，可传入第三方平台的个人用户id、证件号、手机号、邮箱等，如果设置则作为账号唯一性字段，相同信息不可重复创建。
$name = 'your_name'; // 姓名
$idType = 'CRED_PSN_CH_IDCARD'; // 证件类型
$idNumber = 'your_id_number'; // 证件号
$mobile = 'your_mobile'; // 手机号, 签署流程开始时对应的签署人会收到短信通知
$email = 'your_email'; // 邮箱地址, 签署流程开始时对应的签署人会收到邮件通知

// 个人账户创建, 有唯一标志, 需要记录返回的 accountId
$accountInfo = $eSign->account->createPersonAccount($thirdPartyUserId, $name, $idType, $idNumber, $mobile, $email);
$accountId = $accountInfo['accountId'];

// 测试合同模板ID
$templateId = 'd895b34de77041dca853aa454c042cb2';

// 测试合同模板填充变量
$simpleFormFields = [
    '1a54591dcb5f40bb86048743e7e21c18' => '测试名称',
    '9b55340f5a7a4b089dd7c03a397fa4ef' => '测试甲方',
    'c7efd37736a94e1c85ffb21fd0de88ff' => date('Y-m-d'),
];

// 根据模板创建文档
$fileInfo = $eSign->file->createByTemplateId($templateId, '租赁合同', $simpleFormFields);
$fileId = $fileInfo['fileId'];

// 创建一个签署流程
$flowInfo = $eSign->signflow->createSignFlow("租赁合同");
$flowId = $flowInfo['flowId'];

// 把文档加入签署流程中
$addDocRet = $eSign->signflow->addDocuments($flowId, $fileId);

// 在签署流程中添加一个手动签署区域, 前提是流程已经添加文档, 同时指定签署人 accountId
$handSignData = $eSign->signflow->addHandSign($flowId, $fileId, $accountId, 1, 100, 100);

// 签署流程开始, 签署人会收到通知 (前提有 mobile/email)
$startSignFlowRet = $eSign->signflow->startSignFlow($flowId);
echo $startSignFlowRet;
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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

2

Last Release

1464d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32f77100f1ad701643a061f0ecbb40b0fb084bf0bb2c88cd73188edb81e0e8e1?d=identicon)[lmh](/maintainers/lmh)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lmh-esign/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.0k](/packages/laravel-framework)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

346132.9M112](/packages/google-cloud-core)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)[pantheon-systems/terminus

A command line interface for Pantheon

3391.5M18](/packages/pantheon-systems-terminus)

PHPackages © 2026

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