maximof / laravel-messager
:package_description
Requires
- illuminate/support: ~7|~8
Requires (Dev)
- orchestra/testbench: ~5|~6
- phpunit/phpunit: ~9.0
This package is auto-updated.
Last update: 2024-06-20 22:23:56 UTC
README
Laravel Messager
This is a wrapper for a few sms service providers in Nigeria. This package is meant just for laravel so feel free to install in your app to extend its capablilities. Take a look at contributing.md to see a to do list.
Installation
Via Composer
$ composer require maximof/laravel-messager
Usage
This is a fairly easy package to implement. This package works strictly on Laravel 7 and upwards. As Laravel implements package autodiscovery from Laravel 5+ you do not need to add the provider to Laravel's provider array. Publish the config file by running
$ php artisan vendor:publish --provider="Maximof\LaravelMessager\LaravelMessagerServiceProvider"
After you have published the config file, set your environmental variables.
Variable | Description |
---|---|
SMS_SENDER | set the sms sender |
BULK_SMS_NIGERIA_TOKEN | set the bulk sms Nigeria api token |
SMART_SMS_SOLUTIONS_TOKEN | set the smart sms solutions api token |
To generate an API token, for Smart sms solutions visit this link, you can do this only after registering on their site here.
To generate an API for Bulk sms Nigeria visit this link. Remember also to register here
Only two service providers have been implemented in this package
Service Provider | Description |
---|---|
Smartsmssolutions API | this is the API for www.smartsmssolutions.com. To get an api token head to Smart Sms Solutions to get one |
Bulksmsnigeria API | this is the API for www.bulksmsnigeria.com. To understand how the process works on their end head over to Bulk Sms Nigeria |
To send messages you can just pull in the class in your code like this
$sms = new BulkSmsNigeria(); $sms->to(08105612094)->from("Maximof")->body("Hello!"); //this will return a true value if the message is successfully sent or will throw an exception if an error occurs
To check your sms units balance
$sms = new SmartSmsSolution(); $sms->balance(); //this returns a string containing the sms units balance //this only works for the SmartSmsSolutions class as the BulkSmsNigeria class api has no balance checking endpoint
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email favourmaxoti@outlook.com instead of using the issue tracker.
Credits
License
MIT. Please see the license file for more information.