2017 © Pedro Peláez
 

library alidayu

Simple and easy to use, a laravel package of alidayu.

image

larastarscn/alidayu

Simple and easy to use, a laravel package of alidayu.

  • Friday, February 10, 2017
  • by DearMadMan
  • Repository
  • 1 Watchers
  • 12 Stars
  • 947 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 5 Versions
  • 2 % Grown

The README.md

Larastarscn AliDaYu

License, (*1)

Introduction

This package provides a simple and convenient interface to AliDaYu. It make you request any interface of AliDaYu in just a minute., (*2)

Installion

To get started with AliDaYu, add to your composer.json file as a dependency:, (*3)

composer require larastarscn/alidayu

Then type the composer install command to the cli., (*4)

Configure

After installing the AliDaYu libary, register the Larastarscn\AliDaYu\AliDaYuServiceProvider in your config/app.php configuration file:, (*5)

'providers' => [
    // Other service providers...

    Larastarscn\AliDaYu\AliDaYuServiceProvider::class,
]

Also, add the AliDaYu facades to the aliases array in your app.php configuration file:, (*6)

'AliDaYu' => Larastarscn\AliDaYu\Facades\AliDaYu::class

Then, you will need to publish the alidayu.php configuration file to the config directory:, (*7)

php artisan vendor:publish

Also, you will need register the application infomation within config/alidayu.php., (*8)

Usage

Now you can request any interface by AliDaYu facades, to send an sms, you may code like this:, (*9)

<?php
namespace App\Http\Controllers;

use AliDaYu;

class AliDaYuController extends Controller
{
    public function sendSms()
    {
        $response = AliDaYu::driver('sms')->send([
            'extend' => 'wang',
            'sms_type' => 'normal',
            'sms_free_sign_name' => 'test',
            'sms_param' => '{"code": "3052", "name": "Dearmadman"}',
            'rec_num' => '18949825252',
            'sms_template_code' => 'SMS_16691757'
        ]);

        dd($response->getBody()->getContents());
    }
}

Next, we will list the rest of interface in fllow:, (*10)

alibaba.aliqin.fc.sms.num.query, (*11)

$response = AliDaYu::driver('sms')->query([
    'rec_num' => 18949825252,
    'query_date' => '20161011',
    'current_page' => 1,
    'page_size' => 10,
]);

alibaba.aliqin.fc.tts.num.singlecall, (*12)

$response = AliDaYU::driver('tts')->singleCall([
    'extend' => 'wang',
    'tts_param' => '{"name": "wang", "code": "Dearmadman"}',
    'called_num' => 18949825252,
    'called_show_num' => '051482043271',
    'tts_code' => 'TTS_16825713'
]);

alibaba.aliqin.fc.voice.num.singlecall, (*13)

$response = AliDaYu::driver('voice')->singleCall([
    'extend' => 'wang',
    'called_num' => 18949825252,
    'called_show_num' => '051482043271',
    'voice_code' => '2fc5d547-71c0-45e6-8b06-1f3dc40b630c.wav',
]);

alibaba.aliqin.fc.voice.num.doublecall, (*14)

$response = AliDaYu::driver('voice')->doubleCall([
    'extend' => 'Dearmadman',
    'caller_num' => 18949825252,
    'caller_show_num' => '51482043271',
    'called_num' => 18949825250,
    'called_show_num' => '51482043271',
]);

alibaba.aliqin.fc.flow.query, (*15)

$response = AliDaYu::driver('flow')->query([
    'out_id' => 'out_id'  // options
]);

alibaba.aliqin.fc.flow.charge, (*16)

$response = AliDaYu::driver('flow')->charge([
    'phone_num' => 18949825252,
    'reason' => 'no reason',
    'grade' => '50',
    'out_recharge_id' => '6d9fce1e',
]);

alibaba.aliqin.fc.flow.grade, (*17)

$response = AliDaYu::driver('flow')->grade();

alibaba.aliqin.fc.flow.charge.province, (*18)

$response = AliDaYu::driver('flow')->chargeProvince([
    'phone_num' => 18949825252,
    'reason' => 'no reason',
    'grade' => '50',
    'out_recharge_id' => '6d9fce1e',
]);

Simple like this and easy to use. :), (*19)

The Versions

10/02 2017

dev-master

9999999-dev

Simple and easy to use, a laravel package of alidayu.

  Sources   Download

MIT

The Requires

 

by Avatar DearMadMan

laravel sms alidayu larastarscn

10/02 2017

v0.0.4

0.0.4.0

Simple and easy to use, a laravel package of alidayu.

  Sources   Download

MIT

The Requires

 

by Avatar DearMadMan

laravel sms alidayu larastarscn

21/01 2017

v0.0.3

0.0.3.0

Simple and easy to use, a laravel package of alidayu.

  Sources   Download

MIT

The Requires

 

by Avatar DearMadMan

laravel sms alidayu larastarscn

18/10 2016

v0.0.2

0.0.2.0

Simple and easy to use, a laravel package of alidayu.

  Sources   Download

MIT

The Requires

 

by Avatar DearMadMan

laravel sms alidayu larastarscn

12/10 2016

v0.0.1

0.0.1.0

Simple and easy to use, a laravel package of alidayu.

  Sources   Download

MIT

The Requires

 

by Avatar DearMadMan

laravel sms alidayu larastarscn