This package makes it easy to send AirSob notifications with Laravel 5.3.
You can install the package via composer:
composer require kasoprecede47/air-sob
You must install the service provider:
// config/app.php
'providers' => [
...
AirSob\AirSobServiceProvider::class,
],
Add your AirSob Account Key, Acess Token, and From Number (optional) to your config/services.php
:
// config/services.php
...
'airSob' => [
'service_id' => 'Your Service Id',
'service_key' => 'Your Key',
'format' => 'json'
],
...
Now you can use the channel in your via()
method inside the notification:
use AirSob\AirSobChannel;
use AirSob\AirSobMessage;
use Illuminate\Notifications\Notification;
class ValentineDateApproved extends Notification
{
public function via($notifiable)
{
return [AirSobChannel::class];
}
public function toAirSob($notifiable)
{
return (new AirSobMessage('Your {$notifiable->service} account was approved!'));
}
}
In order to let your Notification know which phone number you are sending to, add the routeNotificationForAirSob
method to your Notifiable model e.g your User Model
public function routeNotificationForAirSob()
{
return $this->phone; // where `phone` is a field in your users table;
}
setDestination('')
: Accepts a phone to use as the notification sender.setMesssage('')
: Accepts a string value for the notification body.
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please email kasoprecede47@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.