bluedot-bd/laravel-bulk-sms

Bulk SMS (HTTP API) integration for Laravel (with notification support)

1.0.3 2022-07-22 10:38 UTC

This package is auto-updated.

Last update: 2024-09-22 15:21:17 UTC


README

Latest Version on Packagist Total Downloads

A simple Bulk SMS (HTTP API) for Laravel (with notification support).

Installation

You can install the package via composer:

composer require bluedot-bd/laravel-bulk-sms

add followings in .env :
if your provider use OAuth, API Key, JWT Token or any Header based authentication, use followings

SMS_DRY=true
SMS_AUTH=""
SMS_ENDPOINT=""
SMS_METHOD=""
SMS_FROM=""
SMS_FROM_PARAM=""
SMS_TO_PARAM=""
SMS_MESSAGE_PARAM=""

If your provider use username and password for authentication, use followings

SMS_DRY=true
SMS_ENDPOINT=""
SMS_METHOD=""
SMS_USERNAME=""
SMS_USER_PARAM=""
SMS_PASSWORD=""
SMS_PASS_PARAM=""
SMS_FROM=""
SMS_FROM_PARAM=""
SMS_TO_PARAM=""
SMS_MESSAGE_PARAM=""

Usage

You can use it in Notification:

use LaravelBulkSms;
use Bluedot\LaravelBulkSms\SmsChannel;

public function via($notifiable)
{
    return [SmsChannel::class];
}

/**
 * Get the sms representation of the notification.
 *
 * @param  mixed  $notifiable
 */
public function toSms($notifiable)
{
    return (new LaravelBulkSms)
        ->to()
        ->line();
}

or you can use it directly:

use LaravelBulkSms;
$sms = new LaravelBulkSms();
$sms->to('01xxxx')->from('01xxxx')->message('Your SMS Text')->send();

Security

If you discover any security related issues, please email me@saiful.im instead of using the issue tracker.

Credits

License

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