Jusibe notifications channel for Laravel 5.3 [DEPRECATED]
, (*1)
This package makes it easy to send Jusibe notifications with Laravel 5.3., (*2)
Contents
Installation
You can install the package via composer:, (*3)
``` bash
composer require unicodeveloper/laravel-notification-channel-jusibe, (*4)
You must install the service provider:
```php
// config/app.php
'providers' => [
...
NotificationChannels\Jusibe\JusibeServiceProvider::class,
],
Setting up your Jusibe account
Add your Jusibe Account Key, Acess Token, and From Number (optional) to your config/services.php:, (*5)
// config/services.php
...
'jusibe' => [
'key' => env('JUSIBE_PUBLIC_KEY'),
'token' => env('JUSIBE_ACCESS_TOKEN'),
'sms_from' => 'PROSPER'
]
...
Usage
Now you can use the channel in your via() method inside the notification:, (*6)
``` php
use NotificationChannels\Jusibe\JusibeChannel;
use NotificationChannels\Jusibe\JusibeMessage;
use Illuminate\Notifications\Notification;, (*7)
class ValentineDateApproved extends Notification
{
public function via($notifiable)
{
return [JusibeChannel::class];
}, (*8)
public function toJusibe($notifiable)
{
return (new JusibeMessage())
->content("Your {$notifiable->service} account was approved!");
}
}, (*9)
In order to let your Notification know which phone are you sending to, add the `routeNotificationForJusibe` method to your Notifiable model e.g your User Model
```php
public function routeNotificationForJusibe()
{
return $this->phone; // where `phone` is a field in your users table;
}
Available Message methods
JusibeMessage
-
from(''): Accepts a phone to use as the notification sender.
-
content(''): Accepts a string value for the notification body.
Changelog
Please see CHANGELOG for more information what has changed recently., (*10)
Testing
bash
$ composer test, (*11)
Security
If you discover any security related issues, please email prosperotemuyiwa@gmail.com instead of using the issue tracker., (*12)
Contributing
Please see CONTRIBUTING for details., (*13)
Credits
License
The MIT License (MIT). Please see License File for more information., (*14)