Package Data | |
---|---|
Maintainer Username: | unicodeveloper |
Maintainer Contact: | prosperotemuyiwa@gmail.com (Prosper Otemuyiwa) |
Package Create Date: | 2016-03-18 |
Package Last Update: | 2019-11-12 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-19 03:07:57 |
Package Statistics | |
---|---|
Total Downloads: | 14,265 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 8 |
Total Watchers: | 3 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Laravel 5 Wrapper for Jusibe
Before you go ahead to install the package, make sure you have Jusibe PHP library installed.
PHP 5.5+ or HHVM 3.3+, and Composer are required First, pull in the package through Composer.
$ composer require unicodeveloper/laravel-jusibe
Another alternative is to simply add the following line to the require block of your composer.json
file.
"unicodeveloper/laravel-jusibe": "1.0.*"
Then run composer install
or composer update
to download it and have the autoloader updated.
Once Laravel Jusibe is installed, you need to register the service provider. Open up config/app.php
and add the following to the providers
key.
Unicodeveloper\JusibePack\JusibeServiceProvider::class
Also, register the Facade like so:
'aliases' => [
...
'Jusibe' => Unicodeveloper\JusibePack\Facades\Jusibe::class,
...
]
You can publish the configuration file using this command:
php artisan vendor:publish --provider="Unicodeveloper\JusibePack\JusibeServiceProvider"
A configuration-file named jusibe.php
with some sensible defaults will be placed in your config
directory:
<?php
return [
/**
* Public Key From Jusibe Dashboard
*
*/
'publicKey' => getenv('JUSIBE_PUBLIC_KEY'),
/**
* Access Token From Jusibe Dashboard
*
*/
'accessToken' => getenv('JUSIBE_ACCESS_TOKEN'),
];
Get the publicKey
and accessToken
from Jusibe API Keys Section
Available methods for use are:
/**
* Send SMS using the Jusibe API
* @param array $payload
* @return object
*/
Jusibe::sendSMS($payload)->getResponse();
/**
* Check the available SMS credits left in your Jusibe account
* @return object
*/
Jusibe::checkAvailableCredits()->getResponse();
/**
* Check the delivery status of a sent SMS
* @param string $messageID
* @return object
*/
Jusibe::checkDeliveryStatus('8nb1wrgdjw')->getResponse();
<?php
$message = "I LOVE YOU, BABY";
$payload = [
'to' => '7079740987',
'from' => 'PROSPER DATING NETWORK',
'message' => $message
];
try {
$response = Jusibe::sendSMS($payload)->getResponse();
print_r($response);
} catch(Exception $e) {
echo $e->getMessage();
}
<?php
try {
$response = Jusibe::checkAvailableCredits()->getResponse();
print_r($response);
} catch(Exception $e) {
echo $e->getMessage();
}
<?php
try {
$response = Jusibe::checkDeliveryStatus('8nb1wrgdjw')->getResponse();
print_r($response);
} catch(Exception $e) {
echo $e->getMessage();
}
Please see CHANGELOG for more information what has changed recently.
You can run the tests with:
vendor/bin/phpunit run
Alternatively, you can run the tests like so:
composer test
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.
If you discover any security related issues, please email prosperotemuyiwa@gmail.com instead of using the issue tracker.