aizhar777 / laravel_mobizon
Mobizon Notifications channel for Laravel
0.1.2
2018-04-29 13:56 UTC
Requires
- php: >=5.6.4
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
- illuminate/notifications: 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*
- illuminate/queue: 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*
- illuminate/support: 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.5.*|5.6.*
- mobizon/mobizon-php: 1.0.*
Requires (Dev)
- mockery/mockery: ^0.9.5
- phpunit/phpunit: ^5.2
This package is not auto-updated.
Last update: 2024-11-19 04:42:36 UTC
README
This package makes it easy to send notifications using mobizon.kz with Laravel.
Installation
You can install the package via composer:
composer require aizhar777/laravel_mobizon
Publish the configs:
php artisan vendor:publish --provider="Aizhar777\Mobizon\MobizonServiceProvider"
Then you must install the service provider:
// config/app.php 'providers' => [ ... Aizhar777\Mobizon\MobizonServiceProvider::class, ],
Install your Api key in the config:
// config/mobizon.php return [ 'alphaname' => null, 'secret' => 'Your secret API key', ];
Usage
You can use the channel in your via()
method inside the notification:
use Illuminate\Notifications\Notification; use Aizhar777\Mobizon\MobizonMessage; use Aizhar777\Mobizon\MobizonChanel; class AccountApproved extends Notification { public function via($notifiable) { return [MobizonChanel::class]; } public function toMobizon($notifiable) { return MobizonMessage::create("Task #{$notifiable->id} is complete!"); } }
In your notifiable model, make sure to include a routeNotificationForMobizon() method, which return the phone number.
public function routeNotificationForMobizon() { return $this->phone; }