This package makes it easy to send SMS notifications using Mobizon with Laravel 5.3.
You can install this package via composer:
composer require laraketai/mobizon
Laravel 5.5 < Add the service provider to config/app.php
:
// config/app.php
'providers' => [
...
Laraketai\Mobizon\MobizonServiceProvider::class,
],
Publish Config File config/mobizon.php
:
php artisan vendor:publish --provider="Laraketai\Mobizon\MobizonServiceProvider"
Log in to your Mobizon and grab your Api, Api Secret Key. Add them to config/services.php
.
// config/mobizon.php
...
'mobizon' => [
'alphaname' => null, //Optional, if you don't have registered alphaname, just skip this param and your message will be sent with our free common alphaname.
'secret' => env('MOBIZON_APP_KEY'), // Your secret API key
],
Follow Laravel's documentation to add the channel your Notification class:
use Illuminate\Notifications\Notification;
use Laraketai\Mobizon\MobizonChannel;
use Laraketai\Mobizon\MobizonMessage;
public function via($notifiable)
{
return [MobizonChannel::class];
}
public function toMobizon($notifiable)
{
return MobizonMessage::create("Task #{$notifiable->id} is complete!");
}
Add a routeNotificationForMobizon
method to your Notifiable model to return the phone number:
public function routeNotificationForMobizon()
{
//Phone Number without symbols or spaces
return $this->phone_number;
}
content()
- (string), SMS notification body
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email sanzhar@aketai.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.