PHPackages                             hinet/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. [HTTP &amp; Networking](/categories/http)
4. /
5. hinet/laravel-sms

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hinet/laravel-sms
=================

SMS gateway package for laravel,supports Alibaba cloud SMS, Tencent cloud SMS, SendCloud SMS and Baidu cloud SMS. It is easy to expand and you can freely define your own gateway driver.

1.4.2(4y ago)54185MITPHPPHP ^7.2.5|^7.3|^8.0|^8.1

Since Apr 27Pushed 3y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (25)Used By (0)

laravel-sms
===========

[](#laravel-sms)

基于Laravel与Lumen的短信发送网关，支持阿里云短信、腾讯云短信、百度云短信、SendCloud；极易扩展，你可以自由定义自已的网关驱动。

安装
--

[](#安装)

composer require hinet/laravel-sms

配置
--

[](#配置)

- 注册服务提供器 在config/app.php文件中providers数组里加入：

```
Hinet\Sms\SmsServiceProvider::class,
```

在config/app.php文件中的aliases数组里加入

```
'Sms' => Hinet\Sms\Facades\Sms::class,
```

- 发布配置文件

```
php artisan vendor:publish --tag=smsconfig
```

- 注意事项

在web路由中，可以使用session或cache来存储状态；在api路由需要使用cache存储，因为api中间件中不含session会话支持

```
//config/sms.php
//存储器
'storage' => [
        'prefix' => '',//存储key的前缀
        'driver' => 'cache',//存储方式,内置可选的值有'session'和'cache',api路由中请使用cache
]
```

网关
--

[](#网关)

平台网关名称阿里云aliyun腾讯云qcloud百度云baidu聚合juhesendcloudsendcloud使用方法
----

[](#使用方法)

```
