2017 © Pedro Peláez
 

library notification-channel-direkto

Notification channel Direkto.

image

csgt/notification-channel-direkto

Notification channel Direkto.

  • Thursday, March 15, 2018
  • by csgt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 25 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 56 % Grown

The README.md

Direkto notifications channel for Laravel 5.4+

Latest Version on Packagist Software License Total Downloads, (*1)

This package makes it easy to send [Direkto notifications] with Laravel 5.4., (*2)

Contents

Installation

You can install the package via composer:, (*3)

``` bash composer require csgt/notification-channel-direkto, (*4)


You must install the service provider: ```php // config/app.php 'providers' => [ ... NotificationChannels\Direkto\DirektoProvider::class, ],

Setting up your Direkto account

Add your Direkto Account SID, Auth Token, and From Number (optional) to your config/services.php:, (*5)

// config/services.php
...
'direkto' => [
    'account_url'   => env('DIREKTO_ACCOUNT_URL'),
    'account_token' => env('DIREKTO_AUTH_TOKEN'),
],
...

Usage

Now you can use the channel in your via() method inside the notification:, (*6)

``` php use NotificationChannels\Direkto\DirektoChannel; use NotificationChannels\Direkto\DirektoMessage; use Illuminate\Notifications\Notification;, (*7)

class AccountApproved extends Notification { public function via($notifiable) { return [DirektoChannel::class]; }, (*8)

public function toDirekto($notifiable)
{
    return (new DirektoMessage())
        ->content("Your {$notifiable->service} account was approved!");
}

}, (*9)


In order to let your Notification know which phone are you sending/calling to, the channel will look for the `celular` attribute of the Notifiable model. If you want to override this behaviour, add the `routeNotificationForDirekto` method to your Notifiable model. ```php public function routeNotificationForDirekto() { return $this->mobile; }

Available Message methods

DirektoSmsMessage

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

Changelog

Please see CHANGELOG for more information what has changed recently., (*10)

Security

If you discover any security related issues, please email jgalindo@cs.com.gt instead of using the issue tracker., (*11)

Contributing

Please see CONTRIBUTING for details., (*12)

Credits

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions