alhelwany / laravel-mtn
A simple Laravel notification Channel that utilizes MTN Syria services to send SMS
Fund package maintenance!
Alhelwany
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.2
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
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.