A simple Laravel notification Channel that utilizes MTN Syria services to send SMS
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),
];
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);
composer test
The MIT License (MIT). Please see License File for more information.