Download the PHP package advancelearn/otp-auth without Composer
On this page you can find all versions of the php package advancelearn/otp-auth. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download advancelearn/otp-auth
More information about advancelearn/otp-auth
Files in advancelearn/otp-auth
Package otp-auth
Short Description otp generate for one field from client and after create otp you can checked is true token
License MIT
Informations about the package otp-auth
Advancelearn Otp-auth

Introduction
Welcome to the first package from AdvanceLearn Academy. In this package, we tried to make it easy to create a validation code that is easily available to you, and after receiving the code and token, send it to the user via SMS or email to fill in the form. Validate the user to enter this token and then we will validate the token with the username you send and return the result to you.
Installation
You can install the package with Composer.
Usage
The advancelearn/otp-auth
, It is enough to create an object from the main class of the package and in the first step,
call the method related to creating the token and send the value of the username to it.
new Object of advancelearn/otp-auth:
and call generateToken method::
add namespace of package to top your php class
now call method generateToken and passed data for generate new token and set time for caching otp code
Username can be the user's email or mobile phone
In this section, you have received the code. Now, according to your project scenario, you can send the validation code to the user, and in the next step, receive the token from the user and send it to the package validation method for accuracy:
Conclusion
With this advanced learning package called advancelearn/otp-auth, you can easily send the user's username and receive the token, and you will not have the trouble of creating or saving the token in the database, because the token for the user's username is easily cached according to the time you give. and in the second step, the token validation is applied to the requested username, and according to that, you can successfully register the user in the system or direct the user to the resend code page.