ofcold/luminous-sms

A powerful international SMS push.

3.0.2 2018-06-21 02:24 UTC

This package is auto-updated.

Last update: 2024-10-29 05:34:16 UTC


README

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

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