Package Data | |
---|---|
Maintainer Username: | lakshmaji |
Package Create Date: | 2016-04-21 |
Package Last Update: | 2021-05-08 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-14 15:07:14 |
Package Statistics | |
---|---|
Total Downloads: | 966 |
Monthly Downloads: | 7 |
Daily Downloads: | 0 |
Total Stars: | 4 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
##WHAT IT IS?
##INSTALLATION
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
OTP(integer, string)
use UniqueCode;
UniqueCode::OTP(otp_length, otp_charcaters_domain)
| 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 <lakshmajee88@gmail.com>
*/
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
@ MUTYALA ANANTHA LAKSHMAJI