softon/sms
Composer 安装命令:
composer require softon/sms
包简介
Simple SMS Gateway Package for sending short text messages from your Application. Facade for Laravel 5.Currently supported Gateways Clickatell , MVaayoo, Gupshup, SmsAchariya, SmsCountry , SmsLane , Nexmo, Mocker / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used fo
关键字:
README 文档
README
Simple SMS(Short Messaging Service) Gateway Package for sending short text messages from your Application. Facade for Laravel 5(Updated to work with Laravel 5.*).Currently supported Gateways Clickatell, MVaayoo, Gupshup, SmsAchariya, SmsCountry, SmsLane, Nexmo, Mocker, MSG91 / Any HTTP/s based Gateways are supported by Custom Gateway. Log gateway can be used for testing.
Installation
- Edit the composer.json add to the require array & run composer update
composer require softon/sms - (Optional for Laravel 5.5+) Add the service provider to the config/app.php file in Laravel
Softon\Sms\SmsServiceProvider::class, - (Optional for Laravel 5.5) Add an alias for the Facade to the config/app.php file in Laravel
'Sms' => Softon\Sms\Facades\Sms::class, - Publish the config & views by running
php artisan vendor:publish --provider="Softon\Sms\SmsServiceProvider"
Usage
Edit the config/sms.php. Set the appropriate Gateway and its parameters. Then in your code...
Put your blade template for the SMS in the resources/views/sms folder. Then use the below lines of code to send SMS.
use Softon\Sms\Facades\Sms;
Send Single SMS with View:-
// Params: [MobileNumber,Blade View Location,SMS Params If Required] Sms::send('9090909090','sms.test',['param1'=>'Name 1']);
Send Single SMS with Raw Message:-
// Params: [MobileNumber,Blade View Location,SMS Params If Required] Sms::send('9090909090','Any Message Text To be sent.');
Send Multiple SMS:-
// Params: [Array of MobileNumbers,Blade View Location,SMS Params If Required] Sms::send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1']);
Select the Gateway before sending the Message:-
/***************************************************** Gateways :: log / clickatell / gupshup / mvaayoo / smsachariya / smscountry / smslane / nexmo / msg91 / mocker / custom *****************************************************/ Sms::gateway('mocker')->send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1']);
With Response:-
// This command gives you the reply recieved from the server. Sms::send(['87686655455','1212121212','2323232323'],'sms.test',['param1'=>'Name 1'])->response();
Custom Gateway
Let us suppose you want to use any other gateway. Find the API url with which sms can be sent.
For Example : http://example.com/api/sms.php?uid=737262316a&pin=YOURPIN&sender=your_sender_id&route=0&mobile=8888888888&message=How are You&pushid=1
Then you can setup the Config of Custom Gateway like this:
'custom' => [ // Can be used for any gateway 'url' => '', // Gateway Endpoint 'params' => [ // Parameters to be included in the request 'send_to_name' => 'mobile', // Name of the field of recipient number 'msg_name' => 'message', // Name of the field of Message Text 'others' => [ // Other Authentication params with their values 'uid' => '737262316a', 'pin' => 'YOURPIN', 'sender' => 'your_sender_id', 'route' => '0', 'pushid' => '1', ], ], 'add_code' => true, // Append country code to the mobile numbers ],
softon/sms 适用场景与选型建议
softon/sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29.77k 次下载、GitHub Stars 达 48, 最近一次更新时间为 2015 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「nexmo」 「clickatell」 「sms gateway」 「gupshup」 「mvaayoo」 「smsachariya」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 softon/sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 softon/sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 softon/sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Monolog Handler for SMS messaging services such as Twilio, Clickatell and Plivo.
A modern, flexible Laravel package for integrating any SMS gateway with REST API support
This package makes it easy to send sms using clickatell.com with Laravel 5.
Clickatell notifications driver
A PHP library to send and receive SMS text messages through various gateways/providers.
PHP library for sending SMS through various gateways
统计信息
- 总下载量: 29.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 50
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-04-17