daemon144key / zenziva-notification-channel
Zenziva SMS notifications driver.
Installs: 3 886
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.6.4
- illuminate/notifications: 5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*
- illuminate/support: 5.3.*|5.4.*|5.5.*|5.6.*|5.7.*|5.8.*
- rmccue/requests: ^1.7
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-11-10 06:33:31 UTC
README
This package makes it easy to send SMS notifications using zenziva.id with Laravel 5.3 onward.
Contents
Installation
You can install the package via composer:
composer require daemon144key/zenziva-notification-channel
You must install the service provider and add to your config/app.php
(skip for Laravel 5.5 onward):
// config/app.php 'providers' => [ ... TuxDaemon\ZenzivaNotificationChannel\ZenzivaServiceProvider::class, ],
Additionally you can add related facade in config/app.php
:
// config/app.php 'aliases' => [ ... 'ZenzivaClient' => TuxDaemon\ZenzivaNotificationChannel\Facades\ZenzivaFacade::class, ],
Setting up the zenziva-notification-channel service
Add your Zenziva account userkey and passkeyto your config/services.php
:
// config/services.php ... 'zenziva' => [ 'userkey' => env('ZENZIVA_SMS_CLIENT_USERKEY', ''), 'passkey' => env('ZENZIVA_SMS_CLIENT_PASSKEY', ''), 'masking' => env('ZENZIVA_SMS_CLIENT_MASKING', false) ], ...
Usage
You can use the channel in your via()
method inside the notification:
use Illuminate\Notifications\Notification; use TuxDaemon\ZenzivaNotificationChannel\ZenzivaMessage; use TuxDaemon\ZenzivaNotificationChannel\ZenzivaChannel; class OrderCreated extends Notification { public function via($notifiable) { return [ZenzivaChannel::class]; } public function toZenziva($notifiable) { return ZenzivaMessage::create("Your order had created!"); } }
Or call the function from facade :
use ZenzivaClient; class Something { public function send($to, $msg) { return ZenzivaClient::send("081234567890", "hello world"); } public function checkBalance() { return ZenzivaClient::checkBalance(); } }
Or from CLI artisan command :
$ php artisan zenziva:send 081234567890 "hello world"
$ php artisan zenziva:checkbalance
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please use the issue tracker.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.