PHP code example of lakshmaji / uniquecode

1. Go to this page and download the library: Download lakshmaji/uniquecode library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lakshmaji / uniquecode example snippets


  Lakshmaji\UniqueCode\UniqueCodeServiceProvider::class,

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

OTP(integer, string) 

use UniqueCode;

UniqueCode::OTP(otp_length, otp_charcaters_domain) 




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