mdap / pigeon
pigeon 包是 otp 包
dev-master
2020-10-13 07:35 UTC
Requires
- php: ^7.2.5
- ext-json: *
- psr/http-client: ^1.0
Requires (Dev)
- ext-curl: *
- ergebnis/composer-normalize: ^2.0
- php-http/client-integration-tests: dev-phpunit8
- phpunit/phpunit: ^8.5.5
- psr/log: ^1.1
This package is auto-updated.
Last update: 2024-09-13 16:46:27 UTC
README
Pigeon,PHP 简单 OTP 包
Pigeon 是一个用于分发、存储、验证和过期一次性密码的简单接口
安装
您可以使用以下命令安装此包
$ composer require mdap/pigeon
使用方法
分发驱动器
<?php namespace foo\Dispatcher; use Pigeon\Dispatcher\AbstractDispatcher; class DispatchDriver extends AbstractDispatcher { public function send() { //TODO: send OTP message with different ways, such as : E-mail,SMS,and etc ... } }
在您的控制器中
<?php namespace foo\Controller; use foo\Dispatcher; class FooController extends Controller { public function index() { $dispatchDriver = new DispatchDriver('md.alipour91@gmail.com',1234); $pigeon = new Pigeon(); $pigeon->send($dispatchDriver); } }