GithubHelp home page GithubHelp logo

dgvai / laravel-notification-channel-onnorokomsms Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 10 KB

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: MIT License

PHP 100.00%
laravel-notification-channels onnorokom-sms-service laravel-package composer-package laravel-notifications

laravel-notification-channel-onnorokomsms's Introduction

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.

laravel-notification-channel-onnorokomsms's People

Contributors

dgvai avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.