laraflow/sms
Composer 安装命令:
composer require laraflow/sms
包简介
This package allow users to change the sms driver without affecting the notification class or route name.
关键字:
README 文档
README
Laraflow/SMS is a fast and lightweight sms channel collection for laravel application. This package allow users to integrate different SMS gateway api without any hassle.
Installation
You can install the package via composer:
composer require laraflow/sms
You can publish the config file with:
php artisan vendor:publish --tag="sms-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | Default Vendor |-------------------------------------------------------------------------- | this configuration is used to tell system which vendor | should be used when sending the sms. | Note: if set null package will use laravel default log driver. */ 'default' => env('SMS_DRIVER', null), /* |-------------------------------------------------------------------------- | Vendor Account Mode |-------------------------------------------------------------------------- | this configuration is used to tell system which vendor account | mode should be used when sending the sms. Available options are | "sandbox" or "live". */ 'mode' => env('SMS_ACCOUNT_MODE', 'sandbox'), /* |-------------------------------------------------------------------------- | SMS Sender Name |-------------------------------------------------------------------------- | this configuration is used to tell system what value will be used | if sms vendor support sms name masking. */ 'from' => env('SMS_FROM_NAME', env('APP_NAME', 'Laravel')), /* |-------------------------------------------------------------------------- | Response Logger |-------------------------------------------------------------------------- | this configuration is for debugging purpose. if enabled then program will log | sms vendor response in debug category. */ 'log' => (bool)env('SMS_LOG', env('APP_DEBUG', false)), /* |-------------------------------------------------------------------------- | Response Log Viewer |-------------------------------------------------------------------------- | this configuration is for debugging purpose. if enabled then program will log | sms vendor response in debug category. */ 'log_viewer' => [ 'enabled' => env('SMS_LOG_VIEWER', env('APP_DEBUG', false)), 'uri' => 'sms-logs', 'middleware' => null, ], /* |-------------------------------------------------------------------------- | Vendor Configuration |-------------------------------------------------------------------------- | | This value will be added to all your routes from this package | Example: APP_URL/{root_prefix}/api/bell/action | | Note: while adding prefix add closing ending slash '/' */ 'providers' => [ //Global Providers::AFRICAS_TALKING => [ 'driver' => \Laraflow\Sms\Drivers\AfricasTalking::class, 'live' => [ 'url' => 'https://api.africastalking.com/version1/messaging', 'api_key' => env('SMS_AFRICA_TALKING_API_KEY'), 'username' => env('SMS_AFRICA_TALKING_USERNAME'), ], 'sandbox' => [ 'url' => 'https://api.sandbox.africastalking.com/version1/messaging', 'api_key' => env('SMS_AFRICA_TALKING_API_KEY'), 'username' => env('SMS_AFRICA_TALKING_USERNAME'), ], ], Providers::CLICK_A_TELL => [ 'driver' => \Laraflow\Sms\Drivers\ClickATell::class, 'live' => [ 'api_key' => env('SMS_CLICKATELL_API_KEY'), ], 'sandbox' => [ 'api_key' => env('SMS_CLICKATELL_API_KEY'), ], ], Providers::CLICK_SEND => [ 'driver' => \Laraflow\Sms\Drivers\ClickSend::class, 'live' => [ 'username' => env('SMS_CLICKSEND_USERNAME'), 'password' => env('SMS_CLICKSEND_PASSWORD'), ], 'sandbox' => [ 'username' => env('SMS_CLICKSEND_USERNAME'), 'password' => env('SMS_CLICKSEND_PASSWORD'), ], ], Providers::INFOBIP => [ 'driver' => \Laraflow\Sms\Drivers\Infobip::class, 'live' => [ 'token' => env('SMS_INFOBIP_API_TOKEN'), ], 'sandbox' => [ 'token' => env('SMS_INFOBIP_API_TOKEN'), ], ], Providers::MESSAGE_BIRD => [ 'driver' => \Laraflow\Sms\Drivers\MessageBird::class, 'live' => [ 'access_key' => env('SMS_MESSAGE_BIRD_ACCESS_KEY'), ], 'sandbox' => [ 'access_key' => env('SMS_MESSAGE_BIRD_ACCESS_KEY'), ], ], Providers::SMS_BROADCAST => [ 'driver' => \Laraflow\Sms\Drivers\SmsBroadcast::class, 'live' => [ 'username' => env('SMS_SMSBROADCAST_USERNAME'), 'password' => env('SMS_SMSBROADCAST_PASSWORD'), ], 'sandbox' => [ 'username' => env('SMS_SMSBROADCAST_USERNAME'), 'password' => env('SMS_SMSBROADCAST_PASSWORD'), ], ], Providers::TELNYX => [ 'driver' => \Laraflow\Sms\Drivers\Telnyx::class, 'live' => [ 'token' => env('SMS_TELNYX_API_TOKEN'), ], 'sandbox' => [ 'token' => env('SMS_TELNYX_API_TOKEN'), ], ], Providers::TWILIO => [ 'driver' => \Laraflow\Sms\Drivers\Twilio::class, 'live' => [ 'url' => env('SMS_TWILIO_URL'), 'username' => env('SMS_TWILIO_USERNAME'), 'password' => env('SMS_TWILIO_PASSWORD'), ], 'sandbox' => [ 'url' => env('SMS_TWILIO_URL'), 'username' => env('SMS_TWILIO_USERNAME'), 'password' => env('SMS_TWILIO_PASSWORD'), ], ], Providers::SMS_API => [ 'driver' => \Laraflow\Sms\Drivers\SmsApi::class, 'live' => [ 'api_token' => env('SMS_SMSAPI_API_TOKEN', ''), ], 'sandbox' => [ 'api_token' => env('SMS_SMSAPI_API_TOKEN', ''), ], ], // ... ], ];
Note: Complete list of all the sms vendors are given in driver configuration section.
Auditory
This document was last updated at {docsify-updated}.
laraflow/sms 适用场景与选型建议
laraflow/sms 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 193 次下载、GitHub Stars 达 8, 最近一次更新时间为 2024 年 04 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「twilio」 「notification」 「laravel」 「clickatell」 「messagebird」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 laraflow/sms 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laraflow/sms 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 laraflow/sms 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This package makes it easy to send notifications via AfricasTalking with Laravel
Apple Push Notification & Feedback Provider
Throttle notifications on a per-channel basis
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Componente para integração com serviços de mensageria com APIs externas como Twilio, SendGrid, AWS SES, etc.
Extensible library for building notifications and sending them via different delivery channels.
统计信息
- 总下载量: 193
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 31
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-07