unicodeveloper/laravel-jusibe 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

unicodeveloper/laravel-jusibe

Composer 安装命令:

composer require unicodeveloper/laravel-jusibe

包简介

A Jusibe Bridge for Laravel 5

README 文档

README

Latest Stable Version License Build Status Quality Score Total Downloads

Laravel 5 Wrapper for Jusibe

Installation

Before you go ahead to install the package, make sure you have Jusibe PHP library installed.

PHP 7.0+ 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,
    ...
]

Configuration

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

Usage

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();

Send an SMS

<?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();
}

Check SMS Credits

<?php

try {
   $response = Jusibe::checkAvailableCredits()->getResponse();
   print_r($response);
} catch(Exception $e) {
   echo $e->getMessage();
}

Check Delivery Status

<?php

try {
    $response = Jusibe::checkDeliveryStatus('8nb1wrgdjw')->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}

Send a Bulk SMS

<?php

// include your composer dependencies
require_once 'vendor/autoload.php';

use Unicodeveloper\Jusibe\Jusibe;

$publicKey = 'xxxxxxxxxxxxxx';
$accessToken = 'xxxxxxxxxxxxxx';

$jusibe = new Jusibe($publicKey, $accessToken);

$message = "You are invited for party!!!";

$payload = [
    'to' => '7079740987,8077139164',
    'from' => 'DOZIE GROUP',
    'message' => $message
];

try {
    $response = $jusibe->sendBulkSMS($payload)->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}

Response Info for Developer

Send BulkSMS Response

Check Bulk Delivery Status

<?php

// include your composer dependencies
require_once 'vendor/autoload.php';

use Unicodeveloper\Jusibe\Jusibe;

$publicKey = 'xxxxxxxxxxxxxx';
$accessToken = 'xxxxxxxxxxxxxx';

$jusibe = new Jusibe($publicKey, $accessToken);

try {
    $response = $jusibe->checkBulkDeliveryStatus('n2v9gby1jy')->getResponse();
    print_r($response);
} catch(Exception $e) {
    echo $e->getMessage();
}

Response Info for Developer

Check Bulk Delivery Status Response

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

You can run the tests with:

vendor/bin/phpunit run

Alternatively, you can run the tests like so:

composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

Security

If you discover any security related issues, please email prosperotemuyiwa@gmail.com instead of using the issue tracker.

统计信息

  • 总下载量: 14.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-09-05

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固