vectoor/laravel-multi-sms-methods
Composer 安装命令:
composer require vectoor/laravel-multi-sms-methods
包简介
multi payment methods for laravel,A package dedicated to complete control and work with more than one gateway smoothly and simultaneously
README 文档
README
Laravel Package For SMS Methods Multi Methods Usage.
A package dedicated to complete control and work with more than one gateway smoothly and simultaneously
🚀 About Me
I'm a Full-stack Developer with more than 8 years of a unique experience, I'm a self-learner and specialize in applying the best practices to design and implement scalable, concurrent, flexible, and robust software solutions, with a healthy focus on the expected business outcomes, Always I seek to gain new skills and grow up my knowledge.
Supported Methods
Features
- Send Single SMS
- Send Multi SMS
- Send OTP SMS
- Check Sent OTP
- Send Scheduled Sms
- Send WhatsApp Message
- Get Sent SMS Details
- Get Account Balance
Installation
You Can Install Via Composer
composer require vectoor/laravel-multi-sms-methods
Publish
You Should Publish Config File To Set Method Credentials
php artisan vendor:publish --provider="Vector\LaravelMultiSmsMethods\Providers\SmsServiceProvider"
Config
Example Of Config File
<?php
return [
/*
|--------------------------------------------------------------------------
| Sms Available Methods
|--------------------------------------------------------------------------
/ @author Vector <mo.khaled.yousef@gmail.com>
| Here are each of the Available sms Methods
|
*/
"enable_send_sms" => env('ENABLE_SEND_SMS', true), //Enable or Disable Sending Sms
'methods' => [
/*
|--------------------------------------------------------------------------
| Sms Box Connection
|--------------------------------------------------------------------------
|
| Here are credentials for Sms Box gateway.
|
*/
'smsbox' => [
'username' => env('SMSBOX_USERNAME'),
'password' => env('SMSBOX_PASSWORD'),
'gateway_id' => env('SMSBOX_GATEWAY_ID'),
'sender_id' => env('SMSBOX_SENDER_ID'),
],
/*
|--------------------------------------------------------------------------
| Sms Misr Connection
|--------------------------------------------------------------------------
|
| Here are credentials for Sms Misr gateway.
|
*/
'smsmisr' => [
'username' => env('SMSMISR_USERNAME'),
'password' => env('SMSMISR_PASSWORD'),
'sender_token' => env('SMSMISR_SENDER_TOKEN'),
'template_token' => env('SMSMISR_TEMPLATE_TOKEN'),
'sandbox' => env('SMSMISR_SANDBOX'),
],
/*
|--------------------------------------------------------------------------
| Sms EG Connection
|--------------------------------------------------------------------------
|
| Here are credentials for Sms EG gateway.
|
*/
'smseg' => [
'username' => env('SMSEG_USERNAME'),
'password' => env('SMSEG_PASSWORD'),
'sender_id' => env('SMSEG_SENDER_ID'),
],
/*
|--------------------------------------------------------------------------
| Ooredoo Connection
|--------------------------------------------------------------------------
|
| Here are credentials for Ooredoo gateway.
|
*/
'ooredoo' => [
'username' => env('OOREDOO_USERNAME'),
'password' => env('OOREDOO_PASSWORD'),
'sender_id' => env('OOREDOO_SENDER_ID'),
'customer_id' => env('OOREDOO_CUSTOMER_ID'),
],
/*
|--------------------------------------------------------------------------
| Victory Link Connection
|--------------------------------------------------------------------------
|
| Here are credentials for Victory Link gateway.
|
*/
'victorylink' => [
'username' => env('VICTORYLINK_USERNAME'),
'password' => env('VICTORYLINK_PASSWORD'),
'sender_id' => env('VICTORYLINK_SENDER_ID'),
],
/*
|--------------------------------------------------------------------------
| Twilio Connection
|--------------------------------------------------------------------------
|
| Here are credentials for Twilio gateway.
|
*/
'twilio' => [
'account_sid' => env('TWILIO_ACCOUNT_SID'),
'auth_token' => env('TWILIO_AUTH_TOKEN'),
'sms_phone_number' => env('TWILIO_SMS_PHONE_NUMBER'),
'schedule_messaging_service_sid' => env('TWILIO_SCHEDULE_MESSAGING_SERVICE_SID'),
'whatsapp_phone_number' => env('TWILIO_WHATSAPP_PHONE_NUMBER'),
],
]
];
Facade Usage
Use Sms Facade
use Vector\LaravelMultiSmsMethods\Facade\Sms;
Usage/Examples
Supported Gateways
| Gateway | Key |
|---|---|
SMS BOX |
smsbox |
TWILIO |
twilio |
SMS EG |
smseg |
SMS Misr |
smsmisr |
Victory Link |
victorylink |
Ooredoo |
ooredoo |
Supported Methods
| Available Methods | smsbox | smsmisr | smseg | twilio | ooredoo | victorylink |
|---|---|---|---|---|---|---|
sendSms |
supported |
supported |
supported |
supported |
supported |
supported |
sendMultiSms |
supported |
supported |
supported |
supported |
supported |
Not Supported |
sendScheduleSms |
supported |
supported |
Not Supported | supported |
supported |
Not Supported |
sendWhatsappMessage |
Not Supported | Not Supported | Not Supported | supported |
Not Supported | Not Supported |
sendOtp |
Not Supported | supported |
supported |
Not Supported | Not Supported | Not Supported |
checkOtp |
Not Supported | Not Supported | supported |
Not Supported | Not Supported | Not Supported |
getSmsDetails |
Not Supported | Not Supported | Not Supported | supported |
supported |
Not Supported |
getBalance |
Not Supported | Not Supported | supported |
Not Supported | supported |
supported |
Request
To Send Single Sms
Example
Sms::driver($gateway)->sendSms($mobileNumber,$message);
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$mobileNumber |
string |
Yes |
Mobile Number |
$message |
string |
Yes |
Message Content |
To Send Multi Sms
Example
Sms::driver($gateway)->sendMultiSms($mobileNumbers,$message);
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$mobileNumbers |
Array |
Yes |
Mobile Numbers |
$message |
string |
Yes |
Message Content |
To Send Schedule Sms
Example
Sms::driver($gateway)->sendScheduleSms($mobileNumber,$message,$scheduleDate);
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$mobileNumber |
string |
Yes |
Mobile Number |
$message |
string |
Yes |
Message Content |
$scheduleDate |
string |
Yes |
dateTime of schedule Message |
To Send OTP Sms
Example
Sms::driver($gateway)->sendOtp($mobileNumber, $otp)
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$mobileNumber |
string |
Yes |
Mobile Number |
$otp |
string |
no in some methods like smsEg |
OTP CODE |
To Check OTP Sms
Example
Sms::driver($gateway)->checkOtp($mobileNumber, $otp)
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$mobileNumber |
string |
Yes |
Mobile Number |
$otp |
string |
Yes |
OTP CODE |
To Send Whatsapp Message
Example
Sms::driver($gateway)->sendWhatsappMessage($mobileNumber,$message);
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$mobileNumber |
string |
Yes |
Whatsapp Mobile Number |
$message |
string |
Yes |
Message Content |
To Get Sms Information
Example
Sms::driver($gateway)->getSmsDetails($messageID);
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
$messageID |
string |
Yes |
ID Of Sent Message |
To Get Account Available Balance
Example
Sms::driver($gateway)->getBalance();
| Variable | Type | Mandatory | Description |
|---|---|---|---|
$gateway |
string |
Yes |
Geteway Key |
Response
Example
array:4 [ "code" => 200 "success" => true "message" => "Message Send Successfully" "data" => array:5 [ "Message" => "Message Send Successfully" "Result" => "true" "NetPoints" => "4995.600" "messageId" => "79539c54-XXXX-XXXX-XXXX-2db9244b1969" "RejectedNumbers" => [] ] ]
| Variable | Type | Description |
|---|---|---|
code |
integer |
Response Code OF The Sent Api |
message |
string |
The Response Message From Api |
success |
bool |
The Response Status (If Success Or Not) |
data |
array |
The Full Response From Api |
Authors
🔗 Links
License
The Laravel SMS Gateway package is open-sourced software licensed under the MIT license.
Support
For support, email mo.khaled.yousef@gmail.com .
vectoor/laravel-multi-sms-methods 适用场景与选型建议
vectoor/laravel-multi-sms-methods 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 232 次下载、GitHub Stars 达 12, 最近一次更新时间为 2022 年 10 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 vectoor/laravel-multi-sms-methods 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vectoor/laravel-multi-sms-methods 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 232
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-22