Jusibe SMS Channel for Laravel 5.3
Installs: 16 263
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 6
Open Issues: 1
Requires
- php: >=7.2
- illuminate/notifications: ~5.5 || ~6.0 || ~7.0
- illuminate/support: ~5.5 || ~6.0 || ~7.0
- unicodeveloper/jusibe-php-lib: 1.0.*
Requires (Dev)
- guzzlehttp/guzzle: ~6.0
- mockery/mockery: ^1.0
- orchestra/testbench: ^4.3 || ~5.1
- phpunit/phpunit: 8.* || 9.*
This package is auto-updated.
Last update: 2024-10-26 11:18:37 UTC
README
This package makes it easy to send Jusibe notifications with Laravel 5.5+, 6.x, & 7.x.
Contents
Installation
You can install the package via composer:
composer require laravel-notification-channels/jusibe
You must install the service provider:
// 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
:
// 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:
use NotificationChannels\Jusibe\JusibeChannel; use NotificationChannels\Jusibe\JusibeMessage; use Illuminate\Notifications\Notification; class ValentineDateApproved extends Notification { public function via($notifiable) { return [JusibeChannel::class]; } public function toJusibe($notifiable) { return (new JusibeMessage()) ->content("Your {$notifiable->service} account was approved!"); } }
In order to let your Notification know which phone number you are sending to, add the routeNotificationForJusibe
method to your Notifiable model e.g your User Model
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.
Testing
$ composer test
Security
If you discover any security related issues, please email prosperotemuyiwa@gmail.com instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.