PHPackages                             lakshmajim/uniquecode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lakshmajim/uniquecode

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lakshmajim/uniquecode
=====================

OTP generating package

1.0.2(9y ago)42241MITPHPPHP &gt;=5.3.0

Since Apr 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/lakshmaji/otp)[ Packagist](https://packagist.org/packages/lakshmajim/uniquecode)[ RSS](/packages/lakshmajim-uniquecode/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Laravel - UniqueCode
====================

[](#laravel---uniquecode)

[Wiki on web](http://lakshmaji.github.io/otp/)

\##WHAT IT IS?

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

---

\##INSTALLATION

- Download package form  .
- 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-available-parameters-and-responses)

\#####Method

```
OTP(integer, string)
```

```
use UniqueCode;

UniqueCode::OTP(otp_length, otp_charcaters_domain)
```

##### The message\_array parameters

[](#the-message_array-parameters)

PARAMETERDESCRIPTIONotp\_lengthThis defines the **length of the random string** generated as out putotp\_charcaters\_domainThis defines the range of charcters taken to generate random string i.e, otp or verification code\##Generating OTP or verification code

```
