PHPackages                             haggag/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. haggag/msegat

ActivePrroject[Utility &amp; Helpers](/categories/utility)

haggag/msegat
=============

Msegat SMS Provider

06PHP

Since Nov 8Pushed 2y agoCompare

[ Source](https://github.com/MahmoudSaidHaggag/msegat-laravel-8)[ Packagist](https://packagist.org/packages/haggag/msegat)[ RSS](/packages/haggag-msegat/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)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 jodeveloper/msegat
```

Publish repository configurations

```
php artisan vendor:publish --provider="jodeveloper\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 jodeveloper\Msegat\Facades\Msegat;

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

- Send SMS to multiple recipients with **custom** sender name ID.

```
    use jodeveloper\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 jodeveloper\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 jodeveloper\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 jodeveloper\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 jodeveloper\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 jodeveloper\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

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 78.9% 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.

### Community

Maintainers

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

---

Top Contributors

[![JoDeveloper](https://avatars.githubusercontent.com/u/18007194?v=4)](https://github.com/JoDeveloper "JoDeveloper (15 commits)")[![mahmoudhaggag641](https://avatars.githubusercontent.com/u/17066788?v=4)](https://github.com/mahmoudhaggag641 "mahmoudhaggag641 (2 commits)")[![sweep-ai-deprecated[bot]](https://avatars.githubusercontent.com/in/307814?v=4)](https://github.com/sweep-ai-deprecated[bot] "sweep-ai-deprecated[bot] (2 commits)")

### Embed Badge

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

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

PHPackages © 2026

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