PHPackages                             valinteca/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. valinteca/msegat

ActiveLibrary

valinteca/msegat
================

valinteca msegat

1.0.0(1y ago)1321MITPHPPHP ^8.2

Since Jul 18Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Msegat package
--------------

[](#msegat-package)

A composer package from Valinteca that introduces an easy integration with [Msegat](https://www.msegat.com/index.php?lang=Ar) platform for Laravel applications.

Features
--------

[](#features)

- Send SMS messages
- Send personalized messages
- Send &amp; verify OTP codes
- Manage senders
- Message cost calculation
- Balance inquiry

Installation
------------

[](#installation)

```
composer require valinteca/msegat

```

To publish configurations:

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

```

This will publish config file to config/msegat.php

Then add these keys to .env file:

```
MSEGAT_USERNAME="VALUE_HERE" # From your msegat subscription
MSEGAT_API_KEY="VALUE_HERE" # From your msegat subscription
MSEGAT_SENDER_NAME="VALUE_HERE" # Custom sender name
MSEGAT_LANG="VALUE_HERE" # Language ("En" or "Ar")

```

Usage
-----

[](#usage)

```
use Valinteca\Msegat\Facades\Msegat;
```

### **Send message**

[](#send-message)

*to:* acccepts number or array of numbers

*at:* accepts time to send in format "Y-m-d H:i:s" or a *Carbon* instance

*message:* acccepts message text

*send:* performs operation and returns response

***Examples***

- with default settings:

```
Msegat::to('05xxxxxxxx')
    ->message('hello world')
    ->send();
```

- Custom sender:
    Use *sender* method for custom sender name. If you didn't use this method then default sender name from config/env will be used.

```
Msegat::sender('another sender')
    ->to('05xxxxxxxx')
    ->message('hello world')
    ->send();
```

- Multiple numbers:
    Pass an array to *to* method.

```
Msegat::to(['05xxxxxxxx', '05xxxxxxxx'])
    ->message('hello world')
    ->send();
```

- At later time:
    Pass datetime to *at* method.

```
// Using string datetime format
Msegat::to('05xxxxxxxx', '05xxxxxxxx')
    ->message('hello world')
    ->at('2023-05-01 20:10:05')
    ->send();

// Using carbon instance
Msegat::to('05xxxxxxxx', '05xxxxxxxx')
    ->message('hello world')
    ->at(now()->addMinutes(5))
    ->send();
```

- Custom options:
    Pass options to *options* method Available options are:

    1- reqBulkId: to get msg id of the bulk (*true* or *false*, default is *false*)

    2- msgEncoding: (*UTF8* or *windows-1256*, default is *UTF8*)

    3- reqFilter: to filter the duplicated numbers (*true* or *false*, default is *true*)

```
Msegat::to('05xxxxxxxx')
    ->options([
        'reqBulkId' => true,
        'msgEncoding' => 'windows-1256',
        'reqFilter' => false,
    ])
    ->message('hello world')
    ->send();
```

### **Send personalized messages**

[](#send-personalized-messages)

Personalized messages are message with different SMS content for each number in array. To send personalized messages use *sendPersonalized* method with an array of variables for each number.

Message body should contain the message body including the variables that should be between curly brackets {}.

```
Msegat::to(['05xxxxxxxx', '05yyyyyyyy'])
    ->message('Hello {name}. Your order {order} will be delivered soon')
    ->sendPersonalized([
        ['name' => 'Mohammed', 'order' => '123'],
        ['name' => 'Ahmed', 'order' => '456'],
    ]);

    // Messages:
    // 05xxxxxxxx: "Hello Mohammed. Your order 123 will be delivered soon"
    // 05yyyyyyyy: "Hello Ahmed. Your order 456 will be delivered soon"
```

### **Send test message**

[](#send-test-message)

You can test Msegat API for free . You will get free sms every day . To test service you can send sms using *sendTestMessage* method.

This method uses predefined sender name and message text. so you will define numbers only.

```
Msegat::to('05xxxxxxxx')
    ->sendTestMessage();
```

### **Balance Inquiry**

[](#balance-inquiry)

To inquire about your balance use *getBalance* method

```
Msegat::getBalance();
```

### **Get messages**

[](#get-messages)

To get messages for bulk ID use *forbulkId* method with *getMessages*. The result is paginated and default return is page 1.

```
Msegat::forBulkId('bulk-id-returned-from-send-method')
    ->getMessages();
```

To define page number use *page* method:

```
Msegat::forBulkId('bulk-id-returned-from-send-method')
    ->page(2)
    ->getMessages();
```

To define limit use *limit* method:

```
Msegat::forBulkId('bulk-id-returned-from-send-method')
    ->page(1)
    ->limit(5)
    ->getMessages();
```

### **Calculate message cost**

[](#calculate-message-cost)

```
Msegat::to(['05xxxxxxxx', '05yyyyyyyy'])
    ->message('this is message')
    ->calculateCost();
```

*Response:*

```
{
    "success": true,
    "data": {
        "cost": "3,9"
    }
}
```

### **Get user balance**

[](#get-user-balance)

```
Msegat::getBalance();
```

*Response:*

```
{
    "success": true,
    "data": {
        "balance": "3042.00"
    }
}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

659d ago

### Community

Maintainers

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

---

Top Contributors

[![kareem-torky](https://avatars.githubusercontent.com/u/38352432?v=4)](https://github.com/kareem-torky "kareem-torky (4 commits)")

### Embed Badge

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

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

PHPackages © 2026

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