PHPackages                             larva/think-sms - 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. larva/think-sms

ActiveLibrary

larva/think-sms
===============

The ThinkPHP SMS package.

1.1.1(3y ago)16.3k1MITPHPPHP ^7.3|^8.0

Since May 26Pushed 3y agoCompare

[ Source](https://github.com/larvatecn/think-sms)[ Packagist](https://packagist.org/packages/larva/think-sms)[ Docs](https://www.larva.com.cn)[ RSS](/packages/larva-think-sms/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (8)Dependencies (2)Versions (9)Used By (0)

think-sms
=========

[](#think-sms)

This is a sms expansion for the thinkphp6

[![License](https://camo.githubusercontent.com/1b0e1e5662dab7da554da141c94519f60bc2723571510ce5eaefe91f04db4c7e/68747470733a2f2f706f7365722e707567782e6f72672f6c617276612f7468696e6b2d736d732f6c6963656e73652e737667)](https://packagist.org/packages/larva/think-sms)[![Latest Stable Version](https://camo.githubusercontent.com/395a34f311c33d498385493d43253a940d0121f5db7f4d815330953e494b0528/68747470733a2f2f706f7365722e707567782e6f72672f6c617276612f7468696e6b2d736d732f762f737461626c652e706e67)](https://packagist.org/packages/larva/think-sms)[![Total Downloads](https://camo.githubusercontent.com/16b59ee93d23474a95d49614d81a4b83b66be7a07d8238858ef3e9798047e698/68747470733a2f2f706f7365722e707567782e6f72672f6c617276612f7468696e6b2d736d732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/larva/think-sms)

特点
--

[](#特点)

1. 支持目前市面多家服务商
2. 一套写法兼容所有平台
3. 简单配置即可灵活增减服务商
4. 内置多种服务商轮询策略、支持自定义轮询策略
5. 统一的返回值格式，便于日志与监控
6. 自动轮询选择可用的服务商
7. 更多等你去发现与改进...

平台支持
----

[](#平台支持)

- [腾讯云 SMS](https://cloud.tencent.com/product/sms)
- [Ucloud](https://www.ucloud.cn)
- [七牛云](https://www.qiniu.com/)
- [SendCloud](http://www.sendcloud.net/)
- [阿里云](https://www.aliyun.com/)
- [云片](https://www.yunpian.com)
- [Submail](https://www.mysubmail.com)
- [螺丝帽](https://luosimao.com/)
- [容联云通讯](http://www.yuntongxun.com)
- [互亿无线](http://www.ihuyi.com)
- [聚合数据](https://www.juhe.cn)
- [百度云](https://cloud.baidu.com/)
- [华信短信平台](http://www.ipyy.com/)
- [253云通讯（创蓝）](https://www.253.com/)
- [融云](http://www.rongcloud.cn)
- [天毅无线](http://www.85hu.com/)
- [阿凡达数据](http://www.avatardata.cn/)
- [华为云](https://www.huaweicloud.com/product/msgsms.html)
- [网易云信](https://yunxin.163.com/sms)
- [云之讯](https://www.ucpaas.com/index.html)
- [凯信通](http://www.kingtto.cn/)
- [UE35.net](http://uesms.ue35.cn/)
- [短信宝](http://www.smsbao.com/)
- [Tiniyo](https://tiniyo.com/)
- [摩杜云](https://www.moduyun.com/)
- [融合云（助通）](https://www.ztinfo.cn/products/sms)
- [蜘蛛云](https://zzyun.com/)
- [融合云信](https://maap.wo.cn/)
- [天瑞云](http://cms.tinree.com/)

环境需求
----

[](#环境需求)

- PHP &gt;= 7.3

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

[](#installation)

```
composer require larva/think-sms -vv
```

add the config file: config/sms.php

add config

```
use Overtrue\EasySms\Strategies\OrderStrategy;

return [
    // HTTP 请求的超时时间（秒）
    'timeout' => 5.0,

    /*
    |--------------------------------------------------------------------------
    | Default Setting
    |--------------------------------------------------------------------------
    |
    | This option defines the default sms gateway that gets used when writing
    | messages to the sms. The name specified in this option should match
    | one of the gateways defined in the "gateways" configuration array.
    |
    */
    'default' => [
        // 网关调用策略，默认：顺序调用
        'strategy' => OrderStrategy::class,

        /*
        |--------------------------------------------------------------------------
        | Default Gateways
        |--------------------------------------------------------------------------
        |
        | This option defines the default sms gateway that gets used when writing
        | messages to the sms. The name specified in this option should match
        | one of the gateways defined in the "gateways" configuration array.
        |
        */
        'gateways' => [

        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Log Gateways
    |--------------------------------------------------------------------------
    |
    | Here you may configure the sms gateways for your application.  This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Drivers: "aliyun", "alidayu", "yunpian", "submail",
    |                    "errorlog", "luosimao", "yuntongxun", "huyi"
    |                    "juhe", "sendcloud", "baidu", "huaxin", "chuanglan"
    |                    "rongcloud", "tianyiwuxian", "twilio", "qcloud", "avatardata"
    |
    */
    'gateways' => [
        //Doc
        // https://github.com/overtrue/easy-sms
    ],
];
```

Use
---

[](#use)

```
try {
    $res = sms('13800138000', ['content'  => '您的验证码为: 6379','template' => '259734', 'data' => [6379]]);
    print_r($res);
} catch (InvalidArgumentException $e) {
    print_r($e->getMessage());
} catch (NoGatewayAvailableException $e) {
    print_r($e->getMessage());
}
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 63.2% 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 ~65 days

Recently: every ~114 days

Total

8

Last Release

1362d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/534cdb651e8c806590fa945c6b5a18f361613848e890db1349f4a9fbcae1a650?d=identicon)[xutongle](/maintainers/xutongle)

---

Top Contributors

[![xutongle](https://avatars.githubusercontent.com/u/46956076?v=4)](https://github.com/xutongle "xutongle (12 commits)")[![xutl](https://avatars.githubusercontent.com/u/20939388?v=4)](https://github.com/xutl "xutl (7 commits)")

---

Tags

mobilephonephpsmsthinkphp

### Embed Badge

![Health badge](/badges/larva-think-sms/health.svg)

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

###  Alternatives

[topthink/think

the new thinkphp framework

8.0k1.2M13](/packages/topthink-think)[topthink/think-queue

The ThinkPHP6 Queue Package

640675.0k75](/packages/topthink-think-queue)[topthink/think-captcha

captcha package for thinkphp

132934.4k68](/packages/topthink-think-captcha)[jaguarjack/catchadmin

The CatchAdmin Background management

8962.6k](/packages/jaguarjack-catchadmin)[topthink/think-migration

96460.8k121](/packages/topthink-think-migration)[zoujingli/think-library

Library for ThinkAdmin

8569.8k18](/packages/zoujingli-think-library)

PHPackages © 2026

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