diff --git a/README.md b/README.md index 4f1972b..4808428 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # NextSMS notification channel for Laravel -[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/nextsms.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/nextsms) +[![Latest Version on Packagist](https://img.shields.io/packagist/v/nextsms/laravel.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/nextsms) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) [![PHPUnit tests](https://github.com/nextsms/laravel-nextsms/actions/workflows/tests.yml/badge.svg)](https://github.com/nextsms/laravel-nextsms/actions/workflows/tests.yml) @@ -40,8 +40,9 @@ You will need to [Register](https://nextsms.co.tz/register/). ```bash AFRICASTALKING_USERNAME="" -AFRICASTALKING_KEY="" +AFRICASTALKING_PASSWORD="" AFRICASTALKING_FROM="" +AFRICASTALKING_ENVIROMENT="production" ``` You can publish the package configuration file: diff --git a/config/nextsms.php b/config/nextsms.php index 06794ec..71cc0c4 100644 --- a/config/nextsms.php +++ b/config/nextsms.php @@ -20,4 +20,10 @@ * */ 'from' => env('NEXTSMS_FROM'), + + /* + * Enviroment from NextSMS + * + */ + 'enviroment' => env('NEXTSMS_ENVIROMENT'), ]; diff --git a/src/NextSmsServiceProvider.php b/src/NextSmsServiceProvider.php index 1102e7f..94cc15e 100644 --- a/src/NextSmsServiceProvider.php +++ b/src/NextSmsServiceProvider.php @@ -27,12 +27,17 @@ public function boot() ->give(function () { $username = config('nextsms.username'); $password = config('nextsms.password'); + $enviroment = config('nextsms.enviroment', 'production'); if (is_null($username) || is_null($password)) { throw InvalidConfiguration::configurationNotSet(); } - return new NextSmsSDK(['username' => $username, 'password' => $password]); + return new NextSmsSDK([ + 'username' => $username, + 'password' => $password, + 'enviroment' => $enviroment + ]); }); }