Sign Up and send free SMS messages.

SMSPoh Notifications Channel for PHP Laravel Framework

Installation

You can install this package via composer:

composer require laravel-notification-channels/smspoh

Setting up the SMSPoh service

Add your SMSPoh token, default sender name (or phone number) to your config/services.php:

// config/services.php
...
'smspoh' => [
    'endpoint' => env('SMSPOH_ENDPOINT', 'https://smspoh.com/api/v2/send'),
    'token' => env('SMSPOH_TOKEN', 'YOUR SMSPOH TOKEN HERE'),
    'sender' => env('SMSPOH_SENDER', 'YOUR SMSPOH SENDER HERE')
],
...

Usage

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

use Illuminate\Notifications\Notification;
use NotificationChannels\Smspoh\SmspohMessage;

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

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

In your notifiable model, make sure to include a routeNotificationForSmspoh() method, which returns a phone number or an array of phone numbers.


Read More

Ref : https://github.com/laravel-notification-channels/smspoh

Publish By: admin

Publish At: 2020-01-07 20:13:10
Blog Share On Facebook