PHPackages                             hossammonir/msegat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. hossammonir/msegat

ActivePrroject[HTTP &amp; Networking](/categories/http)

hossammonir/msegat
==================

Msegat SMS Provider

v1.2.1(1y ago)72.3k1MITPHPPHP &gt;=8.1

Since Jul 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HossamMonir/msegat)[ Packagist](https://packagist.org/packages/hossammonir/msegat)[ RSS](/packages/hossammonir-msegat/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

[![Msegat](https://camo.githubusercontent.com/0df47c04bda100c7d530be78c44424fbb21591164040ff36725ba49b8feb5de8/68747470733a2f2f7777772e6d73656761742e636f6d2f7075626c69632f6173736574732f696d672f6c6f676f2f6d73656761742e706e67)](https://www.msegat.com/)

### About Msegat

[](#about-msegat)

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

### Features

[](#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

[](#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

[](#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"
```

&lt;You can get your api Key from this URL [MSEGAT](https://www.msegat.com/index.php?action=548), after successful login.

### Usage

[](#usage)

#### Sending SMS message

[](#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

[](#json-response-example)

```
{
    "response": {
        "code": "1",
        "message": "Success"
    }
}
```

#### OTP ( One Time Password )

[](#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

[](#json-response-example-1)

```
{
    "response": {
        "code": "1",
        "message": "Success"
    },
    "pin": "7693"
}
```

#### Inquiries

[](#inquiries)

Caculate message cost with Msegat

```
    use HossamMonir\Msegat\Facades\Msegat;

    Msegat::numbers(['9665xxxxxxxx', '9665xxxxxxxx', '9665xxxxxxxx'])
        ->message('Hello World')
        ->calculateCost();
```

###### JSON Response Example

[](#json-response-example-2)

```
{
    "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

[](#json-response-example-3)

```
{
    "response": [
        {
            "SenderID": "Digital",
            "Status": "Refused"
        },
        {
            "SenderID": "DigitalTunnel",
            "Status": "Activated"
        }
    ]
}
```

Get Account Balance

```
    use HossamMonir\Msegat\Facades\Msegat;

    Msegat::getBalance();
```

###### JSON Response Example

[](#json-response-example-4)

```
{
    "response": {
        "balance": 964795
    }
}
```

#### Error Codes

[](#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

[](#license)

Msegat package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance46

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~163 days

Recently: every ~214 days

Total

7

Last Release

422d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.0

v1.0.1PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/daaa4f805b79d764eac83ee63b19e11c967605dcf8a6b4f51ef0101f8e97a70d?d=identicon)[HossamMonir](/maintainers/HossamMonir)

---

Top Contributors

[![hossammonir](https://avatars.githubusercontent.com/u/66947877?v=4)](https://github.com/hossammonir "hossammonir (11 commits)")[![jeffwray](https://avatars.githubusercontent.com/u/164155?v=4)](https://github.com/jeffwray "jeffwray (1 commits)")

### Embed Badge

![Health badge](/badges/hossammonir-msegat/health.svg)

```
[![Health](https://phpackages.com/badges/hossammonir-msegat/health.svg)](https://phpackages.com/packages/hossammonir-msegat)
```

###  Alternatives

[binaryk/laravel-restify

Laravel REST API helpers

651399.1k](/packages/binaryk-laravel-restify)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[lomkit/laravel-rest-api

A package to build quick and robust rest api for the Laravel framework.

59152.2k](/packages/lomkit-laravel-rest-api)[wirechat/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

5434.7k](/packages/wirechat-wirechat)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[georgeboot/laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets

10435.5k](/packages/georgeboot-laravel-echo-api-gateway)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
