PHPackages                             bitcodesa/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. bitcodesa/msegat

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

bitcodesa/msegat
================

Notification Channel For Msegate msegat.com

2.5.0(9mo ago)15651MITPHPPHP ^8.2|^8.1CI failing

Since Dec 11Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/BitcodeSA/Msegat)[ Packagist](https://packagist.org/packages/bitcodesa/msegat)[ Docs](https://github.com/bitcodesa/msegat)[ RSS](/packages/bitcodesa-msegat/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (8)Dependencies (10)Versions (8)Used By (0)

Notification Channel For Msegate msegat.com
===========================================

[](#notification-channel-for-msegate-msegatcom)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4a380f5025f062e4bdea860b336229cb971e1e88f20be876731ff72a15a7b392/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626974636f646573612f6d73656761742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bitcodesa/msegat)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/26eea9ac894b38fd8aeee64c01bd984d1487fb5c5f6067847a4a5e1e53288386/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626974636f646573612f6d73656761742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/bitcodesa/msegat/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f5a36540fad31e764c665d790f2b0b163a4b1b5cb5b8dbb2832a5c41030ff198/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626974636f646573612f6d73656761742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bitcodesa/msegat)

Laravel Msegat Notification Channel
-----------------------------------

[](#laravel-msegat-notification-channel)

This package provides a Laravel notification channel for sending SMS messages using the msegat.com SMS provider.

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

[](#installation)

1. **Install the package:**

```
composer require bitcodesa/msegat
```

2. **Publish the config file:**

```
php artisan vendor:publish --tag="msegat-config"
```

3. **Configure the package:**

Edit the published config file (`config/msegat.php`) with your Msegat credentials:

```
return [
    "api_url" => env("MSEGAT_API_URL", "https://www.msegat.com/gw/sendsms.php"),
    "api_key" => env("MSEGAT_API_KEY", ""),
    "username" => env("MSEGAT_USERNAME", ""),
    "sender" => env("MSEGAT_SENDER", ""),
    "unicode" => env("MSEGAT_UNICODE", "UTF8"),
];
```

4. **Configure Msegat service:**

- **Get your credentials:**
    1. Create an account at msegat.com.
    2. Go to your dashboard.
    3. Obtain your API Key, Username, and Sender ID.
- **Set environment variables:**
    1. Open your `.env` file.
    2. Add the following lines, replacing the placeholder values with your credentials:

```
# Msegat credentials
MSEGAT_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxx"
MSEGAT_USERNAME="BITCODE"
MSEGAT_SENDER="BITCODE"
```

5. **Use Messages Log:**if you went to use messages log that create recorde for `Message` model, you have to publish the table:

```
php artisan vendor:publish --tag="msegat-migrations"
```

make sure that you allow the creation through:

```
MSEGAT_MESSAGES_LOG=true
```

you can use `Messageable` trait to get any register that linked to any notifiable model:

```
class User extends Authenticatable
{
    use \BitcodeSa\Msegat\Messageable;
}
```

then you can get messages through:

```
$user->messages
```

Usage
-----

[](#usage)

1. **Add the Msegat channel to your notification class:**

```
