项目作者: dbrax

项目描述 :
This is a laravel library package wrapper for beem.africa sms api
高级语言: PHP
项目地址: git://github.com/dbrax/beem.africa-sms-laravel.git
创建时间: 2020-11-22T12:30:52Z
项目社区:https://github.com/dbrax/beem.africa-sms-laravel

开源协议:MIT License

下载


Beem Africa Sms PHP Package

Latest Version on Packagist
Total Downloads
Emmanuel Mnzava

Installation

  • Laravel Version: => 8.0
  • PHP Version: => 8.0
    You can install the package via composer:
  1. composer require epmnzava/bongolivesms-laravel

Update your config (for Laravel 5.4 and below)

Add the service provider to the providers array in config/app.php:

  1. Epmnzava\BongolivesmsLaravel\BongolivesmsLaravelServiceProvider::class,

Add the facade to the aliases array in config/app.php:

  1. 'Bongolive'=>Epmnzava\BongolivesmsLaravel\BongolivesmsLaravelFacade::class,

Publish the package configuration (for Laravel 5.4 and below)

Publish the configuration file and migrations by running the provided console command:

  1. php artisan vendor:publish --provider="Epmnzava\BongolivesmsLaravel\BongolivesmsLaravelServiceProvider"

Environmental Variables

BEEM_LIVE_KEY your provided beemafrica api key

BEEM_LIVE_SECRET your provided beemafrica secret

BEEM_SENDERID your provided beemafrica senderid

Usage

  1. Sending to one msisdn at a time
  2. <?php
  3. use Bongolive;
  4. class DashboardController extends Controller
  5. {
  6. //
  7. public function runSms(){
  8. //assuming $recipient_msisdn is your receipient number
  9. //we need to change it from 0XXXX to 255XXX
  10. if(substr($recipient_msisdn, 0, 1)==0){
  11. $msisdn = ltrim($recipient_msisdn, "0");
  12. $recipient_msisdn="255"."".$msisdn;
  13. }else{}
  14. $response=Bongolive::send__single_recipient($source_addr,$message,$recipient_msisdn);
  15. }
  16. Sending multiple msisdn at one by passing an array of numbers
  17. <?php
  18. use Bongolive;
  19. class DashboardController extends Controller
  20. {
  21. //
  22. public function runSms(){
  23. //assuming $recipient_msisdn is your receipient number
  24. //we need to change it from 0XXXX to 255XXX
  25. $recipient_array=["255679079774","2556789909"];
  26. $response=Bongolive::send__multiple_recipient($source_addr,$message,$recipient_array);
  27. }

Testing

  1. composer test

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 epmnzava@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.