This package allows to send SMS using Textlocal API using laravel notifications
Supports Laravel 5.5 to 6.x
This package makes it easy to send notifications using textlocal with Laravel 5.3.+
Create an account in textlocal then create an API key or hash(password).
composer require msonowal/laravel-notification-channel-textlocal
default textlocal config update as desired
return [
'username' => env('TEXTLOCAL_USERNAME'),
'password' => env('TEXTLOCAL_PASSWORD'),
'hash' => env('TEXTLOCAL_HASH'),
'api_key' => env('TEXTLOCAL_API_KEY'),
'sender' => env('TEXTLOCAL_SENDER'),
'request_urls' => [
'IN' => 'https://api.textlocal.in/',
'UK' => 'https://api.txtlocal.com/'
],
'country' => env('TEXTLOCAL_COUNTRY', 'IN'),
];
TEXTLOCAL_USERNAME=Your email id or api key
TEXTLOCAL_HASH=get it from url '/docs/' under your API KEYS section
TEXTLOCAL_API_KEY get it from url '/docs/' under your API KEYS section
TEXTLOCAL_SENDER=Name of the Sender that will be displayed to the recipient (max 6 Characters).
TEXTLOCAL_COUNTRY=Your Two letter(ISO-3166-alpha-2) Country Code. It should be the Country of the TEXTLOCAL account.
php artisan vendor:publish --tag=textlocal
Currently, only textlocal of two country is supported IN(India) and UK(United Kingdom).
Implement this method routeNotificationForTextlocal()
in your notifiable class/model which will return array of mobile numbers. Please make sure the mobile number contains the dial code as well (e.g +91 for India). And lastly implement toSms()
method in the notification class which will return the (string) sms or template that is defined in textlocal account that needs to be send.
A list of all available options
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email manash149@gmail.com instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
Need to convert to Guzzle Http as a Client in core Add more countries add tests