This package makes it easy to send notifications using NetGsm with Laravel 5.3 - 7.x.
You can install the package via composer:
composer require laravel-notification-channels/netgsm
Add the environment variables to your config/services.php
:
// config/services.php
...
'netgsm' => [
'user_code' => env('NETGSM_USER_CODE'),
'secret' => env('NETGSM_SECRET'),
'msg_header' => env('NETGSM_HEADER'),
],
...
Add your NetGsm User Code, Default header (name or number of sender), and secret (password) to your .env
:
// .env
...
NETGSM_USER_CODE=
NETGSM_SECRET=
NETGSM_HEADER=
],
...
Now you can use the channel in your via()
method inside the notification:
use NotificationChannels\NetGsm\NetGsmChannel;
use NotificationChannels\NetGsm\NetGsmMessage;
use Illuminate\Notifications\Notification;
class VpsServerOrdered extends Notification
{
public function via($notifiable)
{
return [NetGsmChannel::class];
}
public function toNetGsm($notifiable)
{
return (new NetGsmMessage("Your {$notifiable->service} was ordered!"));
}
}
You can add recipients (single value or array)
return (new NetGsmMessage("Your {$notifiable->service} was ordered!"))->setRecipients($recipients);
Additionally you can change header
return (new NetGsmMessage("Your {$notifiable->service} was ordered!"))->setHeader("COMPANY");
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email drtzack@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.