Skip to content

A simple Laravel notification Channel that utilizes MTN Syria services to send SMS

License

Notifications You must be signed in to change notification settings

alhelwany/laravel-mtn

Repository files navigation

Laravel SMS Gateway for MTN Syria

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A simple Laravel notification Channel that utilizes MTN Syria services to send SMS

Installation

You can install the package via composer:

composer require alhelwany/laravel-mtn

You can publish the config file with:

php artisan vendor:publish --tag="mtn-config"

This is the contents of the published config file:

return [
    'url' => env('MTN_GATEWAY_URL', 'https://services.mtnsyr.com:7443/General/MTNSERVICES/ConcatenatedSender.aspx'),
    'username' => env('MTN_USERNAME', null),
    'password' => env('MTN_PASSWORD', null),
    'from' => env('MTN_FROM', null),
];

Usage

use Alhelwany\LaravelMtn\Enums\Lang;
use Alhelwany\LaravelMtn\Interfaces\MTNNotification;
use Illuminate\Notifications\Notification;
use Alhelwany\LaravelMtn\Channels\MTNChannel;

class MyNotification extends Notification implements MTNNotification
{
	
    public function via(object $notifiable): array
    {
        return [MTNChannel::class];
    }
    public function toText(): string
    {
        return "Hello";
    }
    public function getLang(): Lang
    {
        return Lang::EN;
    }
}
use Illuminate\Database\Eloquent\Model;
use Alhelwany\LaravelMtn\Interfaces\MTNNotifiable;

class User extends Model implements MTNNotifiable
{
    public function getPhone(): string
    {
        return $this->phone;
    }
}
$user->notify(new MyNotification);

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

About

A simple Laravel notification Channel that utilizes MTN Syria services to send SMS

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages