Downloads
Stars
Version
This package makes it easy to send SMS notifications using routee.net with Laravel 5.3+.
Only Routee SMS is implemented at the moment, if you want more channels feel free to write them yourself in RouteeApi or point me to an API wrapper that we can switch to.
Install this package with Composer:
composer require laravel-notification-channels/routee
The service provider gets loaded automatically. Or you can do this manually:
// config/app.php
'providers' => [
...
NotificationChannels\Routee\RouteeServiceProvider::class,
],
Add your Routee application id, application secret and sender id (from) to your config/services.php
:
// config/services.php
'routee' => [
'app_id' => env('ROUTEE_APP_ID'),
'secret' => env('ROUTEE_SECRET'),
'from' => env('ROUTEE_SENDER_ID'),
],
You can use the channel in your via()
method inside the notification:
use Illuminate\Notifications\Notification;
use NotificationChannels\Routee\RouteeMessage;
use NotificationChannels\Routee\RouteeChannel;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [RouteeChannel::class];
}
public function toRoutee($notifiable)
{
return (new RouteeMessage)
->content("Your message here");
}
}
In your notifiable model, make sure to include a routeNotificationForRoutee()
method, which returns a phone number
or an array of phone numbers.
public function routeNotificationForRoutee()
{
return $this->phone;
}
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
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.