This package makes it easy to send messages using Beem.africa with Laravel.It is basicly a wrapper around their API.
You can install the package via composer:
composer require keenops/laravel-sms
After installation, publish the configuration files by running the command:
php artisan vendor:publish --tag=laravel-beem-sms
Add beem.africa API credentials. Can be obtained here
BEEM_API_KEY=
BEEM_API_SECRET=
BEEM_SENDER_NAME=
In your controller use like this
namespace App\Http\Controllers;
use Keenops\Sms\Facades\Sms;
class SMSController extends Controller
{
public function index()
{
$message = "Hello Word"; //String
$recipients = ['255701000001', '255701000002', '25570100003']; //array
return Sms::send($message, $recipients);
//returns a json value with sent status
}
}
In your controller use like this
namespace App\Http\Controllers;
use Keenops\Sms\Facades\Sms;
class SMSController extends Controller
{
public function index()
{
return Sms::viewBalance();
//returns Integer value of the remaining balance E.g 210
}
}
In your controller use like this
namespace App\Http\Controllers;
use Keenops\Sms\Facades\Sms;
class SMSController extends Controller
{
public function index()
{
return Sms::senderNames();
//returns json list of registered sender name E.g 210
}
}
In your controller use like this
namespace App\Http\Controllers;
use Keenops\Sms\Facades\Sms;
class SMSController extends Controller
{
public function index()
{
return Sms::requestNewSenderName('API TEST','This is test api for new sender name using laravel beem package');
//return json value of the new requested sender name
}
}
Specific error codes may be displayed within parenthesis when send or receive operations fail. The most common of these error codes are specified on beem.africa API Documetation
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.