PHPackages                             mythinking/laravel-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. mythinking/laravel-sms

ActiveLibrary

mythinking/laravel-sms
======================

a common sms api for laravel

0.0.15(6y ago)0132MITPHPPHP ^7.0CI failing

Since Aug 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mythinking/laravel-sms)[ Packagist](https://packagist.org/packages/mythinking/laravel-sms)[ RSS](/packages/mythinking-laravel-sms/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (8)Versions (16)Used By (0)

Laravel-sms
===========

[](#laravel-sms)

laravel框架专用发短信，支持多种短信渠道，如创蓝等。

安装
--

[](#安装)

使用composer安装

```
    $ composer require mythinking/laravel-sms

    $ php artisan vendor:publish --provider="Mythinking\LaravelSms\ServiceProvider"

```

使用
--

[](#使用)

#### 1.在app.php的 providers 加入

[](#1在appphp的-providers-加入)

```
    Mythinking\LaravelSms\ServiceProvider::class,

```

#### 2.在app.php的 aliases 加入

[](#2在appphp的-aliases-加入)

```
    'Sms' => Mythinking\LaravelSms\Facades\Sms::class,

```

#### 3.在config/sms.php中配置对应的值

[](#3在configsmsphp中配置对应的值)

- 支持国内/国际短信, 分账号配置
- 支持模板短信
- 每日限制发送短信数量
- 短信有效期

#### 4.代码中使用

[](#4代码中使用)

```
    use Sms;

    $server = Sms::server();
    $server->setConfig(config("sms.cl"));//支持多账号配置,默认cl配置
    $res = $server->send('15988888888','registerCode', ['code'=>123456], function ($res, $data) {
        Log::info($res);//接口返回结果, code=0 成功
            array:3 [▼
              "code" => 101
              "msg" => "无此用户"
              "data" => array:2 [▼
                "msgid" => ""
                "time" => "20190905160335"
              ]
            ]
        Log::info($data);//渠道方返回结果
                array:2 [▼
                  "msg" => "【xxx】您的验证码为：123456，请在三分钟内输入。为了保障您的账户安全，请勿将验证码短信转发他人"
                  "res" => "{"code":"101","msgId":"","time":"20190905160047","errorMsg":"无此用户"}"
                ]
        // db record
        ...
    });

    //清除限制缓存
    $server->clearLimit('15988888888');

```

#### 5. todo

[](#5-todo)

- 更多渠道短信支持, 如阿里云等

支持短信渠道列表
--------

[](#支持短信渠道列表)

- [创蓝](https://zz.253.com/ "创蓝")

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

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 ~4 days

Recently: every ~12 days

Total

15

Last Release

2390d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e826150cef58f64537d30399adb5c4b4c959046e84691ea9fb6cdbd81664e940?d=identicon)[heha2o](/maintainers/heha2o)

---

Tags

sdksms

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mythinking-laravel-sms/health.svg)

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

###  Alternatives

[infobip/infobip-api-php-client

PHP library for consuming Infobip's API

921.8M10](/packages/infobip-infobip-api-php-client)

PHPackages © 2026

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