SmsPilot Notifications channel for Laravel
chevgenio/smspilot-notification-channel is a Laravel package for smspilot notifications channel for laravel.
It currently has 0 GitHub stars and 7 downloads on Packagist (latest version v1.0.0).
Install it with composer require chevgenio/smspilot-notification-channel.
Discover more Laravel packages by chevgenio
or browse all Laravel packages to compare alternatives.
Last updated
This package makes it easy to send notifications using smspilot.ru with Laravel 8.x.
Install this package with Composer:
composer require chevgenio/smspilot-notification-channel
Add your SmsPilot api key, default sender name to your config/services.php:
// config/services.php
...
'smspilot' => [
'apikey' => env('SMSPILOT_APIKEY'),
'sender' => env('SMSPILOT_SENDER', 'INFORM'),
'callback' => env('SMSPILOT_CALLBACK_URL', ''),
'callback_method' => env('SMSPILOT_CALLBACK_METHOD', 'get'),
],
...
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification;
use Chevgenio\SmsPilot\SmsPilotMessage;
use Chevgenio\SmsPilot\SmsPilotChannel;
class NewOrder extends Notification
{
public function via($notifiable)
{
return [SmsPilotChannel::class];
}
public function toSmsPilot($notifiable)
{
return (new SmsPilotMessage)
->content("Order successfully completed.");
}
}
In your notifiable model, make sure to include a routeNotificationForSmspilot method, which returns a phone number
or an array of phone numbers.
public function routeNotificationForSmspilot()
{
return $this->phone;
}
from(): Sets the sender's name. Make sure to register the sender name at you SmsPilot dashboard.
content(): Set a content of the notification message.
sendAt(): Set a time for scheduling the notification message.
Please see CHANGELOG for more information what has changed recently.
$ composer test
The MIT License (MIT). Please see License File for more information.