Skip to content

Laravel Notification Channel Package For OnnorokomSMS (Bangladesh). Using notification in laravel require notification channels where a user will be notified (eg. email, push, sms, slack, etc). This is sms notification channel for laravel.

License

Notifications You must be signed in to change notification settings

dgvai/laravel-notification-channel-onnorokomsms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OnnorokomSMS notifications channel for Laravel

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

This package makes it easy to send sms via OnnorokomSMS bulk SMS Service (Bangladesh) with Laravel 5.5+, 6.x and 7.x.

Contents

Installation

You can install the package via composer:

composer require dgvai/laravel-notification-channel-onnorokomsms

Setting up your configuration

Add your OnnorokomSMS Account credentials to your config/services.php:

// config/services.php
...
'onnorokomsms' => [
    'username'      =>  env('ONNOROKOMSMS_USERNAME'),       // The username of OnnorokomSMS service
    'password'      =>  env('ONNOROKOMSMS_PASSWORD'),       // The password of OnnorokomSMS service
    'type'          =>  env('ONNOROKOMSMS_TYPE'),           // TEXT or UCS 
    'mask_name'     =>  env('ONNOROKOMSMS_MASK_NAME'),      // optional but not null use ''
    'campaign_name' =>  env('ONNOROKOMSMS_CAMPAIGN_NAME'),  // optional but not null use ''
],
...

In order to let your Notification know which phone are you sending to, the channel will look for the mobile_number attribute of the Notifiable model (eg. User model). If you want to override this behaviour, add the routeNotificationForOnnorokomSMS method to your Notifiable model.

public function routeNotificationForOnnorokomSMS()
{
    return '+1234567890';
}

Usage

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

use DGvai\OnnorokomSMS\OnnorokomSMS;
use DGvai\OnnorokomSMS\OnnorokomSMSChannel;
use Illuminate\Notifications\Notification;

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

    public function toOnnorokomSMS($notifiable)
    {
        return new OnnorokomSMS('Your order has been placed!');
    }
}

Changelog

Please see CHANGELOG for more information what has changed recently.

License

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

About

Laravel Notification Channel Package For OnnorokomSMS (Bangladesh). Using notification in laravel require notification channels where a user will be notified (eg. email, push, sms, slack, etc). This is sms notification channel for laravel.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages