PHPackages                             mrwanghongda/sms-sdk - 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. mrwanghongda/sms-sdk

ActiveLibrary

mrwanghongda/sms-sdk
====================

TencentSms,SmsBao,SmsServices

V1.1(4y ago)3309MITPHPPHP ^7.3|^8.0

Since Nov 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/china-ninetyseven/sms-sdk)[ Packagist](https://packagist.org/packages/mrwanghongda/sms-sdk)[ RSS](/packages/mrwanghongda-sms-sdk/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

sms-sdk
=======

[](#sms-sdk)

一个集成腾讯云、短信宝短信发送的工具类

A SMS sending tool class integrating Tencent cloud and SMS treasure

配置参数，可快速实现不同平台的短信发送(目前只支持腾讯云、短信宝)

Configure parameters to quickly send SMS on different platforms

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

[](#installation)

```
composer require china-ninetyseven/sms-sdk
```

example
-------

[](#example)

```
    use App\Factory\SmsFactory;

    /**
     * 短信宝
     */
    const SMS_BAO = 'bao';

    /**
     * 腾讯云
     */
    const SMS_TENCENT = 'tencent';

    /**
     * 阿里云正在开发中...
     */
    const SMS_ALIYUN = 'aliyun';

    //工厂模式
    $smsObj = (new SmsFactory(SmsFactory::SMS_TENCENT))->getSmsService();
    /* 必要步骤：
          * 实例化一个认证对象，入参需要传入腾讯云账户密钥对secretId，secretKey。
          * 这里采用的是从环境变量读取的方式，需要在环境变量中先设置这两个值。
          * 你也可以直接在代码中写死密钥对，但是小心不要将代码复制、上传或者分享给他人，
          * 以免泄露密钥对危及你的财产安全。
          * CAM密匙查询: https://console.cloud.tencent.com/cam/capi*/

        $config = [
            /* 填写平台对应的CAM密匙secretId，短信宝填写平台账号*/
            'secretId' => '',
            /* 填写平台对应的CAM密匙secretKey，短信宝填写平台密码*/
            'secretKey' => '',
            /* 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId，示例如1400006666 ,短信宝默认为空*/
            'smsSdkAppId' => '',
            /* 验证码,示例如5039 */
            'code' => $code,
            /* 填写腾讯、阿里平台对应的签名内容,短信宝则默认为空 */
            'signName' => '',
            /* 发送的手机号,示例如17899873465 */
            'tel' => $tel,
            /* 模板 ID: 必须填写已审核通过的模板 ID。模板ID可登录 [短信控制台] 查看 */
            'templateId' => "",
            /* 模板发送的短信内容，短信宝则需要填写 如："【短信宝】您的验证码是"5390",3分钟有效。", 腾讯、阿里默认为空 */
            'content' => '【短信宝】您的验证码是'.$code.',3分钟有效。',//
        ];

        $result = $smsObj->send($config);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~22 days

Total

2

Last Release

1604d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9066840d7770c0bffe407b96432c5f5976a6dd91a890727e53f7bd158a4ac8eb?d=identicon)[Mrwanghongda](/maintainers/Mrwanghongda)

---

Top Contributors

[![cn-hongdaya](https://avatars.githubusercontent.com/u/255296573?v=4)](https://github.com/cn-hongdaya "cn-hongdaya (5 commits)")[![hongda404](https://avatars.githubusercontent.com/u/47734175?v=4)](https://github.com/hongda404 "hongda404 (2 commits)")

### Embed Badge

![Health badge](/badges/mrwanghongda-sms-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/mrwanghongda-sms-sdk/health.svg)](https://phpackages.com/packages/mrwanghongda-sms-sdk)
```

###  Alternatives

[timacdonald/log-fake

A drop in fake logger for testing with the Laravel framework.

4235.9M54](/packages/timacdonald-log-fake)[jasonmccreary/laravel-test-assertions

A set of helpful assertions when testing Laravel applications.

3513.9M32](/packages/jasonmccreary-laravel-test-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit, functional and acceptance testing.

675.0M774](/packages/typo3-testing-framework)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

31252.7k5](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

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