Skip to content

ofcold/luminous-sms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A powerful international SMS push.

Features

  • Support the current market more than service providers.
  • Simple configuration can flexibly increase or decrease service providers.
  • Unified return format, easy to log and monitor.
  • Automatic polling Select available service providers.
  • Full support for various api interfaces of vendors.
  • Support console operation API.

Platform support

供应商 开发状态 时间
腾讯云 SMS 2018-06-20
云片 🕗 2018-06-21
阿里大鱼 --
百度云 --

Environmental

  • PHP >= 7.1

Intalling

$ composer require ofcold/luminous-sms

Usage

use Ofcold\LuminousSMS\LuminousSMS;
use Ofcold\LuminousSMS\Helpers;
use Ofcold\LuminousSMS\Contracts\MessageInterface;

$sms = new LuminousSMS(include __DIR__ . '/resources/config/sms.php');

//	------------------------------------------------------------------------------------------------
//	Send Message.
$result = $sms->sender(function($messager) {
	$messager
		->setMobilePhone('18898726543')
		->setType(Ofcold\LuminousSMS\Contracts\MessageInterface::VOICE_MESSAGE)
		->setContent('您的验证码是{code}, 验证码将在2分钟后失效!请及时使用。')
		->setPaserData(['code'	=> rand(1000, 9999)]);
});

var_dump($result);

//	------------------------------------------------------------------------------------------------

//	Signature manager
//	Add
//$resuts = $sms->createHandler('qcloud')->getSignature('add', '衣衣布舍');
//
// Query
//$resuts = $sms->createHandler('qcloud')->getSignature('query', [15858, 15859]);
//
//	Edit
$resuts = $sms->createHandler('qcloud')->getSignature('edit', '150986', '你是哪里来');

var_dump($resuts);

License

MIT