2017 © Pedro Peláez
 

library uniquecode

OTP generating package

image

lakshmaji/uniquecode

OTP generating package

  • Wednesday, December 27, 2017
  • by lakshmaji
  • Repository
  • 1 Watchers
  • 6 Stars
  • 431 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 11 % Grown

The README.md

Laravel - UniqueCode

Wiki on web, (*1)

WHAT IT IS?

  • This package is used to generate one-time password [ a random string or number]

INSTALLATION

  • Download package form https://github.com/lakshmaji/otp .
  • OR YOU CAN RUN FOLLOWING COMMAND FROM TERMINAL
  • With composer you can run this line composer require lakshmaji/uniquecode

Run this command from the Terminal:, (*2)

    composer require lakshmaji/uniquecode
    composer update

LARAVEL INTEGRATION

you need to add the service provider. Open app/config/app.php, and add a new item to the providers array., (*3)

  Lakshmaji\UniqueCode\UniqueCodeServiceProvider::class,

Then, add a Facade for more convenient usage. In app/config/app.php add the following line to the aliases array:, (*4)

 'UniqueCode'=> Lakshmaji\UniqueCode\Facade\UniqueCode::class,

Again do composer update, (*5)


METHOD, AVAILABLE PARAMETERS AND RESPONSES

Method
OTP(integer, string) 
use UniqueCode;

UniqueCode::OTP(otp_length, otp_charcaters_domain) 
The message_array parameters
PARAMETER DESCRIPTION
otp_length This defines the length of the random string generated as out put
otp_charcaters_domain This defines the range of charcters taken to generate random string i.e, otp or verification code

Generating OTP or verification code


<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use UniqueCode; /** * UniqueCode - Package usage Example * * @access public * @since 1.2.0 * @author lakshmaji */ class UniqueCodeTest extends Controller { public function testGetOtp() { $code = UniqueCode::OTP(3,'abc45'); echo $code; //This will outputs a4c or 5b2 or ac4 etc } } // end of class UniqueCodeTest // end of file UniqueCodeTest.php

Licence

MIT License (MIT), (*6)

@ MUTYALA ANANTHA LAKSHMAJI, (*7)

The Versions

27/12 2017

dev-master

9999999-dev

OTP generating package

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar lakshmaji

laravel otp

22/04 2017

1.0.2

1.0.2.0

OTP generating package

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar lakshmaji

laravel otp

31/01 2017

v1.0.1

1.0.1.0

OTP generating package

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar lakshmajim

laravel otp

21/04 2016

v1.0

1.0.0.0

OTP generating package

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by Avatar lakshmajim

otp