abusalam/laravel-smsgateway
Composer 安装命令:
composer require abusalam/laravel-smsgateway
包简介
Laravel Implementation of SMS Gateway
README 文档
README
The abusalam/laravel-smsgateway package provides easy to use functions to send sms from your app. Works with CDAC SMS Gateway Services out of the box.
Here's a demo of how you can use it:
use AbuSalam\SmsGateway; # Code... $smsGateway = new SmsGateway; $smsGateway->toRecipient('9876543210') ->withTemplateId('123456789012345678') ->withSms('Computer science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra') ->sendSms(); # Code...
Documentation
You'll find the documentation here.
Installation
You can install the package via composer:
composer require "abusalam/laravel-smsgateway"
The package will automatically register itself.
You can optionally publish the config file with:
php artisan vendor:publish --provider="AbuSalam\SmsGatewayServiceProvider" --tag="config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Default SMS Gateway Name |-------------------------------------------------------------------------- | | Here you may specify which of the SMS Gateways below you wish | to use as your default SMS Gateway for sending SMSs. Of course | you may use many connections at once using the SMS Gateway library. | */ 'default' => env('SMS_GATEWAY', 'local'), /* |-------------------------------------------------------------------------- | SMS Gateways |-------------------------------------------------------------------------- | | Here are each of the SMS Gateways setup for your application. | Of course, examples of configuring each SMS Gateway platform that is | supported by Laravel is shown below to make development simple. | | | All SMS Gateway work in Laravel is done through the PHP SMS facilities | so make sure you have the driver for your particular SMS Gateway of | choice installed on your machine before you begin development. | */ /*============================================================= = Default SMS Gateway API Configuration = =============================================================*/ 'cdacSms' => [ /* SMS Gateway API Endpoint Configurations */ 'apiEndpoint' => env('SMS_URL', 'https://msdgweb.mgov.gov.in/esms/sendsmsrequestDLT'), 'apiMobileNoParam' => env('SMS_MOBILE_NO_PARAM', 'mobileno'), 'apiSmsParam' => env('SMS_SMS_PARAM', 'content'), /* SMS Gateway Constant Parameter Configurations */ 'apiParams' => [ 'apiUserParam' => env('SMS_USERNAME_PARAM', 'username'), 'apiPassParam' => env('SMS_PASSWORD_PARAM', 'password'), 'apiSenderIdParam' => env('SMS_SENDER_ID_PARAM', 'senderid'), 'apiTemplateIdParam' => env('SMS_TEMPLATE_ID_PARAM', 'templateid'), 'apiSecureKeyParam' => env('SMS_API_KEY_PARAM', 'key'), 'apiServiceTypeParam' => env('SMS_SERVICE_TYPE_PARAM', 'smsservicetype'), ], 'apiValues' => [ 'apiUser' => env('SMS_USERNAME', 'dummyuser'), 'apiPass' => sha1(trim(env('SMS_PASSWORD', 'dummypass'))), 'apiSenderId' => env('SMS_SENDER_ID', 'DUMMY'), 'apiTemplateId' => env('SMS_TEMPLATE_ID', '01235468238656'), 'apiSecureKey' => env('SMS_API_KEY', 'top-secret-dummy-key'), 'apiServiceType' => env('SMS_SERVICE_TYPE_PARAM', 'singlemsg'), ] ], /*===== End of Default SMS Gateway API Configuration ======*/ 'local' => [ /* SMS Gateway API Endpoint Configurations */ 'apiEndpoint' => 'http://insp.local.host/api/sms', 'apiMobileNoParam' => 'recipient', 'apiSmsParam' => 'sms', /* SMS Gateway Parameter Configurations */ 'apiParams' => [ 'apiUserParam' => env('SMS_USERNAME_PARAM', 'username'), 'apiPassParam' => env('SMS_PASSWORD_PARAM', 'password'), 'apiSenderIdParam' => env('SMS_SENDER_ID_PARAM', 'senderid'), 'apiSecureKeyParam' => env('SMS_API_KEY_PARAM', 'key'), ], 'apiValues' => [ 'apiUser' => env('SMS_USERNAME', 'dummyuser'), 'apiPass' => sha1(trim(env('SMS_PASSWORD', 'dummypass'))), 'apiSenderId' => env('SMS_SENDER_ID', 'DUMMY'), 'apiSecureKey' => env('SMS_API_KEY', 'top-secret-dummy-key'), ] ], ];
License
The MIT License (MIT). Please see License File for more information.
abusalam/laravel-smsgateway 适用场景与选型建议
abusalam/laravel-smsgateway 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 568 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 09 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 abusalam/laravel-smsgateway 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 abusalam/laravel-smsgateway 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 568
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-09-26