Skip to content

epic-kaso/AirSob

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirSob notifications channel for Laravel 5.3

Latest Version on Packagist Software License Total Downloads

This package makes it easy to send AirSob notifications with Laravel 5.3.

Contents

Installation

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,
],

Setting up your AirSob account

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'
],
...

Usage

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;
}

Available Message methods

AirSobMessage

  • setDestination(''): Accepts a phone to use as the notification sender.
  • setMesssage(''): Accepts a string value for the notification body.

Changelog

Please see CHANGELOG for more information what has changed recently.

Security

If you discover any security related issues, please email kasoprecede47@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.

About

A Laravel 5.3 Notification/PHP Library for Airsob

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages