Git Product home page Git Product logo

otp's Introduction

Laravel - UniqueCode

Wiki on web

##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:

    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.

  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:

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

Again do composer update


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)

@ MUTYALA ANANTHA LAKSHMAJI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.