Laravel 5 wrapper for Esendex SMS
Install via Composer:
composer require davidcb/laravel-esendex
If you're using Laravel >= 5.5, you can skip this as this package will be auto-discovered.
Add the service provider to config/app.php
Davidcb\Esendex\EsendexServiceProvider::class,
You can register the facade in the aliases
array in the config/app.php
file
'Esendex' => Davidcb\Esendex\Facades\Esendex::class,
Publish the config file
$ php artisan vendor:publish --provider="Davidcb\Esendex\EsendexServiceProvider"
Set your API key and Client ID on your .env file
ESENDEX_ACCOUNT=EX000000
ESENDEX_EMAIL=user@example.com
ESENDEX_PASSWORD=secret
You can find all the methods in the original esendex/esendex-php-sdk package.
Examples:
// Send an SMS
$result = LaravelEsendex::send('Sender', '555000000', 'This is the text of the SMS');
// Retrieve inbox messages
$messages = LaravelEsendex::latest();
// Get a message's status
$status = LaravelEsendex::messageStatus('123456');
// Get a message's body
$body = LaravelEsendex::getMessageBodyById('123456');