定制 hopeofiran/avanak-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hopeofiran/avanak-laravel

最新稳定版本:v1.7.4

Composer 安装命令:

composer require hopeofiran/avanak-laravel

包简介

This package helps us to use Avanak services.

README 文档

README

This package helps us to use Avanak services.

installation

To install from composer use the following command

composer require hopeofiran/avanak-laravel

configuration .env file

add account information into .env file

AVANAK_USERNAME=your_username
AVANAK_PASSWORD=your_password

to change default configuration

to access config file and change default configuration use following command

php artisan vendor:publish --provider=hopeofiran\avanak\Providers\AvanakProvider

or you can set config with config($keys[,$value]) method

$credit = \hopeofiran\avanak\Facades\AvanakFacade::config('username', "{$your_username}")
->config('password', "{$your_password}")
->getCredit();

OR

$credit = \hopeofiran\avanak\Facades\AvanakFacade::config(['username'=>"{$your_username}", 'password' => "{$your_password}"])
->getCredit();

also you can modify avanak server address with baseUrl($url) method

$credit = \hopeofiran\avanak\Facades\AvanakFacade::baseUrl("$avanak_new_address")
->getCredit();

How to use this package

CreateCampaign method

to create campaign use createCampaign() method

$title              = 'example title';
$numbers            = ['0912×××6789', '0911×××1111'];
$maxTryCount        = 2;
$minuteBetweenTries = 1;
$start              = now()->addMicros(5);
$end                = now()->endOfDay();
$messageId          = 123456789;
$campaign = \hopeofiran\avanak\Facades\AvanakFacade::createCampaign($title, $numbers, $maxTryCount, $minuteBetweenTries, $start, $end, $messageId);

response

{
  "CreateCampaignResult": 123456789
}

QuickSend method

to quick send message use quickSend() method

$number    = '0912×××6789';
$messageId = 123456789;
$response = \hopeofiran\avanak\Facades\AvanakFacade::quickSend($number, $messageId);

response

{
  "QuickSendResult": 123456789
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-06