定制 hossammonir/msegat 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hossammonir/msegat

最新稳定版本:v1.2.1

Composer 安装命令:

composer require hossammonir/msegat

包简介

Msegat SMS Provider

README 文档

README

Msegat

About Msegat

The leading SMS providers in Saudi Arabia, Maximize your reach with reliable deliverability.

Features

  • Send SMS to multiple recipients.
  • Send SMS to multiple recipients with Customized Sender Name ID.
  • Send OTP.
  • Calculate message cost points.
  • Sender Names ID Inquiry.
  • Balance Inquiry.



Installation

composer require hossammonir/msegat

Publish repository configurations

php artisan vendor:publish --provider="HossamMonir\Msegat\MsegatServiceProvider"

This will publish msegat.php configtations to config/msegat.php



Prepare Environment

Add the following configration to .env file .

MSEGAT_DEFAULT_SENDER="Type your default sender name" MSEGAT_USERNAME="Your Msegat Account Username" MSEGAT_API_KEY="Your API Key"

<You can get your api Key from this URL MSEGAT, after successful login.




Usage

Sending SMS message

  • Send SMS to multiple recipients with default sender name ID that you fill in .env file.
 use HossamMonir\Msegat\Facades\Msegat; Msegat::numbers(['05xxxxxxxx', '05xxxxxxxx']) ->message('Hello World') ->sendWithDefaultSender();
  • Send SMS to multiple recipients with custom sender name ID.
 use HossamMonir\Msegat\Facades\Msegat; Msegat::numbers(['05xxxxxxxx', '05xxxxxxxx']) ->message('Hello World') ->sendWithSender('DigitalTunnel');
JSON Response Example
{ "response": { "code": "1", "message": "Success" } }




OTP ( One Time Password )

  • Send OTP Message with default sender name ID.
 use HossamMonir\Msegat\Facades\Msegat; Msegat::numbers(['05xxxxxxxx']) ->sendOTP();
  • If you would like to send free OTP using OTP sender name you can pass 'OTP' to sendOTP method.
 use HossamMonir\Msegat\Facades\Msegat; Msegat::numbers(['05xxxxxxxx']) ->sendOTP('OTP');
JSON Response Example
{ "response": { "code": "1", "message": "Success" }, "pin": "7693" }




Inquiries

Caculate message cost with Msegat

 use HossamMonir\Msegat\Facades\Msegat; Msegat::numbers(['9665xxxxxxxx', '9665xxxxxxxx', '9665xxxxxxxx']) ->message('Hello World') ->calculateCost();
JSON Response Example
{ "total_numbers": 3, "point_cost": 2.75, "message_length": 23 }




Get All Sender Names ID

 use HossamMonir\Msegat\Facades\Msegat; Msegat::getSenders();
JSON Response Example
{ "response": [ { "SenderID": "Digital", "Status": "Refused" }, { "SenderID": "DigitalTunnel", "Status": "Activated" } ] }




Get Account Balance

 use HossamMonir\Msegat\Facades\Msegat; Msegat::getBalance();
JSON Response Example
{ "response": { "balance": 964795 } }




Error Codes

  • 1 - Success
  • M0000 - Success
  • M0001 - Variables missing
  • M0002 - Invalid login info
  • M0022 - Exceed number of senders allowed
  • M0023 - Sender Name is active or under activation or refused
  • M0024 - Sender Name should be in English or number
  • M0025 - Invalid Sender Name Length
  • M0026 - Sender Name is already activated or not found
  • M0027 - Activation Code is not Correct
  • 1010 - Variables missing
  • 1020 - Invalid login info
  • 1050 - MSG body is empty
  • 1060 - Balance is not enough
  • 1061 - MSG duplicated
  • 1064 - Free OTP , Invalid MSG content you should use "Pin Code is: xxxx" or "Verification Code: xxxx" or "رمز التحقق: 1234" , or upgrade your account and activate your sender to send any content
  • 1110 - Sender name is missing or incorrect
  • 1120 - Mobile numbers is not correct
  • 1140 - MSG length is too long
  • M0029 - Invalid Sender Name - Sender Name should contain only letters, numbers and the maximum length should be 11 characters
  • M0030 - Sender Name should ended with AD
  • M0031 - Maximum allowed size of uploaded file is 5 MB
  • M0032 - Only pdf,png,jpg and jpeg files are allowed!
  • M0033 - Sender Type should be normal or whitelist only
  • M0034 - Please Use POST Method
  • M0036 - There is no any sender

License

Msegat package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 1.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固