Skip to content

Z3d0X/laravel-dhiraagu-sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

You can install the package via composer:

composer require zedox/laravel-dhiraagu-sms

Configuration

Add the following in your config/services.php

'dhiraagu-sms' => [
    'url' => env('DHIRAAGU_SMS_URL'),
    'userid' => env('DHIRAAGU_SMS_USERID'),
    'password' => env('DHIRAAGU_SMS_PASSWORD'),
],

then you can use the .env file to pass these credentials

DHIRAAGU_SMS_USERID=XXXXX
DHIRAAGU_SMS_PASSWORD=XXXXX

While url is optional, you must provide userid and password


Usage

This service can easily be used using the Facade provided

use Zedox\LaravelDhiraaguSms\Facades\DhiraaguSms;

You can use the send method which accepts a mobile no and a message

    DhiraaguSms::send($toMobile, $message)

Example

Route::get('test-sms', function () {
    try {
        DhiraaguSms::send('9607XXXXXX', 'Hello World');
    } catch (\Exception $e) {
        return response()->json(['message' => $e->getMessage()]);
    }
    return response()->json(['message' => 'Success: SMS sent']);
});

About

Dhiraagu Bulk SMS Service API Wrapper for laravel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages