2017 © Pedro Peláez
 

library laravel-notification-channel-voicecombg

VoiceCom BG Notification channel for Laravel 5.3+.

image

yakimka/laravel-notification-channel-voicecombg

VoiceCom BG Notification channel for Laravel 5.3+.

  • Thursday, January 18, 2018
  • by yakimka
  • Repository
  • 0 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

VoiceCom BG notifications channel for Laravel 5.3+

Based on github.com/laravel-notification-channels/smsc-ru, (*1)

This package made for send notifications using voicecombg.bg with Laravel 5.3+., (*2)

Contents

Installation

You can install the package via composer: composer require yakimka/laravel-notification-channel-voicecombg, (*3)

For Laravel < 5.5 you must install the service provider:, (*4)

// config/app.php
'providers' => [
    ...
    NotificationChannels\VoiceComBG\VoiceComBGServiceProvider::class,
],

Setting up the VoiceComBG service

Add your VoiceComBG login, secret key (hashed password) and default sender name (or phone number) to your config/services.php:, (*5)

// config/services.php
...
'voicecombg' => [
    'sid' => env('VOICECOMBG_SID'),
    'url' => 'https://bsms.voicecom.bg/smsapi/bsms/sendsms/',
],
...

Usage

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

use Illuminate\Notifications\Notification;
use NotificationChannels\VoiceComBG\VoiceComBGMessage;
use NotificationChannels\VoiceComBG\VoiceComBGChannel;

class AccountApproved extends Notification
{
    public function via($notifiable)
    {
        return [VoiceComBGChannel::class];
    }

    public function toVoiceComBG($notifiable)
    {
        return VoiceComBGMessage::create("Task #{$notifiable->id} is complete!");
    }
}

In your notifiable model, make sure to include a routeNotificationForVoiceComBG() method, which return the phone number., (*7)

public function routeNotificationForVoiceComBG()
{
    return $this->phone;
}

Available methods

from(): Sets the sender's name or phone number., (*8)

content(): Sets a content of the notification message., (*9)

Security

If you discover any security related issues, please email ss.yakim@gmail.com instead of using the issue tracker., (*10)

Credits

License

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

The Versions