robust-tools/resala
Composer 安装命令:
composer require robust-tools/resala
包简介
Laravel SMS Gateway Integration Package
关键字:
README 文档
README
Resala is a PHP & Laravel Package, (Designed to add support to your laravel or just native php app for sending SMS using local operators in the MENA region Like Vodafone, Infopib, Conneckio, VectoryLink).
Resala not just tied to use inside Laravel you can hook it up in any php code
Supported Providers
- Vodafone SMS Gateway
- Connekio SMS Gateway
- InfoPib SMS Gateway
- Vectory Link SMS Gateway
Installation
You can install the package via composer:
composer require robust-tools/resala
Laravel Usage.
Configure
publish the config file with:
php artisan vendor:publish --provider="RobustTools\Resala\SMSServiceProvider" --tag="config"
This is the contents of the published config file:
return [ /* * You can specify a default service provider driver here. * If it is not set we'll use vodafone as the default driver. */ 'default' => env('SMS_DRIVER', 'vodafone'), /* |-------------------------------------------------------------------------- | List of sms drivers |-------------------------------------------------------------------------- | | This is a list of possible sms gateways drivers | */ 'drivers' => [ 'vodafone' => [ 'end_point' => env('VODAFONE_END_POINT'), 'account_id' => env('VODAFONE_ACCOUNT_ID'), 'password' => env('VODAFONE_PASSWORD'), 'secure_hash' => env('VODAFONE_SECURE_HASH'), 'sender_name' => env('VODAFONE_SENDER_NAME', 'Vodafone') ], 'connekio' => [ 'single_sms_endpoint' => env('SINGLE_SMS_ENDPOINT'), 'batch_sms_endpoint' => env('BATCH_SMS_ENDPOINT'), 'username' => env('CONNEKIO_USERNAME'), 'password' => env('CONNEKIO_PASSWORD'), 'account_id' => env('CONNEKIO_ACCOUNT_ID'), 'sender_name' => env('CONNEKIO_SENDER_NAME') ], 'infobip' => [ 'end_point' => env('INFOBIP_END_POINT'), 'username' => env('INFOBIP_USERNAME'), 'password' => env('INFOBIP_PASSWORD'), 'sender_name' => env('INFOBIP_SENDER_NAME', 'Infobip') ], 'vectory_link' => [ 'end_point' => env('VECTORY_LINK_END_POINT'), 'username' => env('VECTORY_LINK_USERNAME'), 'password' => env('VECTORY_LINK_PASSWORD'), 'sender_name' => env('VECTORY_LINK_SENDER_NAME', 'Vectory Link'), 'lang' => env('VECTORY_LINK_LANG', 'E') ], ], /* |-------------------------------------------------------------------------- | Class Maps |-------------------------------------------------------------------------- | | | This is a list of Classes that maps to the Drivers above. */ 'map' => [ 'vodafone' => VodafoneDriver::class, 'connekio' => ConnekioDriver::class, 'infobip' => InfobipDriver::class, 'vectory_link' => VectoryLink::class ], ];
Available Commands:
This adds vodafone environment variables to your .env file.
php artisan resala:make vodafone
This adds connekio environment variables to your .env file.
php artisan resala:make connekio
This adds infobip environment variables to your .env file.
php artisan resala:make infobip
This adds vectory_link environment variables to your .env file.
php artisan resala:make vectory_link
Usage
SMS::to('010xxxxxxxx') ->message("Hello World") ->send(); SMS::to(['010xxxxxxxx', '011xxxxxxxx']) ->message("Hello World") ->send();
You can inspect the returned response from your sms provider through:
$response = SMS::to(['010xxxxxxxx', '011xxxxxxxx']) ->message("Hello World") ->send(); $response->success(); // returns bool $response->body(); // returns string
you can optionally change the driver using the via method
SMS::via('vodafone') ->to('010xxxxxxxx') ->message("Hello World") ->send();
Outside Laravel
You need to add a config file named resala.php in your project directory the contents of the config file must match the schema of the package config file you can find it HERE.
just replace the env(values) with your driver config values.
use RobustTools\Resala\SMS; $configFile = __DIR__ . "/config/resala.php"; (new SMS($driver, $configFile))->to(['010995162378', '012345522']) ->message("Hello World") ->send();
IF no configuration file is being passed a InvalidArgumentException will be thrown.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email mohabdelaziz95@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
robust-tools/resala 适用场景与选型建议
robust-tools/resala 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.58k 次下载、GitHub Stars 达 22, 最近一次更新时间为 2020 年 04 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sms」 「robust-tools」 「resala」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 robust-tools/resala 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 robust-tools/resala 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 robust-tools/resala 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
SDK for payment gateway PlatbaMobilom.sk for PHP7.0
Extensible library for building notifications and sending them via different delivery channels.
yii2-sms expand
A fork of simplesoftwareio/simple-sms with Verimor driver.
Aakash Sms Provider Api Wrapper
PHP-based SMPP client lib
统计信息
- 总下载量: 7.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 22
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-25