mdap / pigeon
pigeon package is otp package
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: 2025-03-13 17:50:14 UTC
README
Pigeon , PHP simple OTP package
Pigeon is a simple interface for dispatch, store, validate and expire one-time password
Installation
You can install this bundle by the following command:
$ composer require mdap/pigeon
Usage
Dispatcher Driver
<?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 ... } }
In your controller
<?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); } }