owenoj/laravel-bigmsgbox

Laravel notification channel for bigmsgbox

v1.3.4 2022-08-10 23:51 UTC

This package is auto-updated.

Last update: 2024-04-11 03:33:10 UTC


README

Latest Version on Packagist Total Downloads

This package makes it easy to send Bigmsgbox sms notifications with Laravel 8+

Installation

You can install the package via composer:

composer require owenoj/laravel-bigmsgbox

Configuration

BIGMSGBOX_API_KEY=ABXCDSD
BIGMSGBOX_API_SECRET=HFHFK992
BIGMSGBOX_SENDERID=MyCompany

Usage

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

use Owenoj\LaravelBigmsgbox\BigmsgboxChannel;
use Illuminate\Notifications\Notification;

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

    public function toBigmsgbox($notifiable)
    {
        return "Your  account was approved!";//your message
    }
}

You can also send sms via Facade like so:

namespace App\Http\Controllers;

use Owenoj\LaravelBigmsgbox\Bigmsgbox;
use Illuminate\Notifications\Notification;

class AccountController extends Controller
{
    
    public function sendsms()
    {
        $message = "Your  account was approved!";
        $to = '2331234567890';
        return Bigmsgbox::send($to,$message);
    }
}

In order to let your Notification know which phone are you sending to, the channel will look for the phone_number attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForBigmsgbox method to your Notifiable model.

public function routeNotificationForBigmsgbox()
{
    return '2331234567890';
}

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email owen.j@terktrendz.com instead of using the issue tracker.

Credits

License

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

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.