Package Data | |
---|---|
Maintainer Username: | enniel |
Maintainer Contact: | razumov.evgeni@gmail.com (Evgeni Razumov (Enniel)) |
Package Create Date: | 2016-09-06 |
Package Last Update: | 2017-02-03 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-17 03:00:37 |
Package Statistics | |
---|---|
Total Downloads: | 1,660 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 7 |
Total Watchers: | 4 |
Total Forks: | 1 |
Total Open Issues: | 0 |
This package makes it easy to send notifications using Asterisk Manager Interface (AMI) and Asterisk Chan Dongle with Laravel 5.3.
You can install this package via composer:
composer require enniel/laravel-asterisk-notification-channel
Next add the service provider to your config/app.php
:
...
'providers' => [
...
NotificationChannels\Asterisk\AsteriskServiceProvider::class,
],
...
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\Asterisk\AsteriskChannel;
use NotificationChannels\Asterisk\AsteriskMessage;
use Illuminate\Notifications\Notification;
class ExampleNotification extends Notification
{
public function via($notifiable)
{
return [AsteriskChannel::class];
}
public function toAsterisk($notifiable)
{
return AsteriskMessage::create('message text');
}
}
In order to let your Notification know which phone number you are targeting, add the routeNotificationForAsterisk
method to your Notifiable model.
Important note: Asterisk requires the recipients phone number to be in international format. For instance: 0031612345678
public function routeNotificationForAsterisk()
{
return '0031612345678';
}
content('test')
: Set message text.device('modem1')
: Set device for sending SMS message.$ composer test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.