2017 © Pedro Peláez
 

library smsservice

Sms verification code for Laravel 4

image

mrlian/smsservice

Sms verification code for Laravel 4

  • Monday, October 9, 2017
  • by mrlian
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

短信验证码 For Laravel 4

目前接入平台有LuosiMao&YunPian后期将扩展其它平台, (*1)

Installation

Require this package with composer:composer require mrlian/smsservice, (*2)

Usage

Find the providers key in config/app.php and register the SmsService Service Provider., (*3)

'providers' => [
    // ...
    'Mrlian\Smsservice\SmsserviceServiceProvider',
]

Find the aliases key in config/app.php., (*4)

'aliases' => [
    // ...
    'SmsService' => 'Mrlian\Smsservice\Vendor\SmsService',
]

Configuration

To use your own settings, publish config. $ php artisan config:publish mrlian/smsservice Find the config in config/packages/mrlian/smsservice/config.php., (*5)

Example Usage

实例化一个短信平台. $sms = SmsService::factory('YunPian'); $sms->sendSmsCode('yourPhoneNum', 'verificationCode'); 可用方法:, (*6)

  1. $sms->getCode(); 返回短信商信息代码0表示发送成功,其它代码自行查阅
  2. $sms->getMsg(); 返回短信商反馈信息

异常:(用于短信发送失败后切换平台), (*7)

$sms = SmsService::factory('LuosiMao');
$sms->sendSmsCode('yourPhoneNum', 'verificationCode');
try {
    $sms->getCode();
} catch (Mrlian\Smsservice\Vendor\SmsException $e) {
    $sms = SmsService::factory('YunPian');
}

The Versions

09/10 2017

dev-master

9999999-dev https://github.com/479245760/mrlian-smsservice

Sms verification code for Laravel 4

  Sources   Download

The Requires

 

by WenJunLian

laravel laravel 4 sms message l4