shengamo / zmsms
A Laravel package for integrating with an SMS gateway service in Zambia.
Requires
- php: ^8.1|^8.3
- illuminate/support: ~11|~10|~9
Requires (Dev)
- guzzlehttp/guzzle: ^7.2
- orchestra/testbench: ^v8.23.2
- phpunit/phpunit: ^10.5
README
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
Installation
You can install the package via composer:
composer require shengamo/zmsms
Usage
The process of the plugin is first to check if you have enough balance to send out the number of SMS's you would like to send out. If you have enough, the messages will be sent but if you do not have enough remaining you will receive a response of "Insufficient balance".
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Shengamo\Zmsms\ZmsmsServiceProvider"
Add the following environment variables to your .env
file:
ZMSMS_GATEWAY_BASE_URL=https://zmsms.online/api/v1/ ZMSMS_GATEWAY_USERNAME=your_user_name ZMSMS_GATEWAY_PASSWORD=password
Sending SMS
Example usage on how to send SMS from your app
use Shengamo\Zmsms\Facades\Zmsms; Zmsms::sendSMS('senderId', 'Message', ['zambia_mobile number e.g. 0760123456']);
Ensure your sender ID is already registered on zmSMS or the package will return an error.
use Shengamo\Zmsms\Facades\Zmsms; Zmsms::sendSMS('Shengamo', 'Hello from Zmsms!', ['0971977252', '0776639088']);
Checking Balance
use Shengamo\Zmsms\Facades\Zmsms; // Example usage to check SMS balance $balance = Zmsms::getBalance(); echo "Current SMS balance: " . $balance['response_description'];
Testing
vendor/bin/phpunit
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 mo@shengamo.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.