2017 © Pedro Peláez
 

library alidayu

Sliverwing Alidayu API

image

sliverwing/alidayu

Sliverwing Alidayu API

  • Thursday, February 23, 2017
  • by Sliverwing
  • Repository
  • 2 Watchers
  • 3 Stars
  • 125 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Laravel-Alidayu

Usage

  • composer require sliverwing/alidayu
  • add Sliverwing\Alidayu\AlidayuServiceProvider::class, to your config/app.php file
  • php artisan vendor:publish --provider="Sliverwing\Alidayu\AlidayuServiceProvider"
  • edit config/alidayu.php put your appkey & secretKey
  • put your sms config in sms array
  • edit your .env file and make sure you have proper QUEUE_DRIVER configuration
  • add ALIDAYU_APPKEY and ALIDAYU_SECRET in your .env file
  • php artisan queue:work
  • edit your controller where you need to send sms
use Sliverwing\Alidayu\Jobs\AlidayuMessageJob;

//... in some action
$this->dispatch(new AlidayuMessageJob($phoneNumber, $paramInYourTemplate, $configNameInAlidayuConfig));

  • then you will see result in console

example

  • I have my config/alidayu.php like this:
<?php

return [
    'appkey' => env('ALIDAYU_APPKEY'),
    'secretKey' => env('ALIDAYU_SECRET'),

    'sms' => [
        'numsend' => [
            'SmsFreeSignName' => '医*',
            'SmsTemplateCode' => 'SMS_3*******',
        ],
    ],
];
  • My template is 您的注册码为 ${code}
  • I can send my verification code via
    $this->dispatch(new AlidayuMessageJob($phoneNumber, ['code'=>$code], "numsend"));

Thanks to https://github.com/flc1125/alidayu, (*1)

The Versions

23/02 2017

dev-master

9999999-dev

Sliverwing Alidayu API

  Sources   Download

MIT

The Requires

 

by Avatar Sliverwing

17/12 2016

0.0.1

0.0.1.0

Sliverwing Alidayu API

  Sources   Download

MIT

The Requires

 

by Avatar Sliverwing