Download the PHP package signaturetech/laravel-otp without Composer
On this page you can find all versions of the php package signaturetech/laravel-otp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download signaturetech/laravel-otp
More information about signaturetech/laravel-otp
Files in signaturetech/laravel-otp
Package laravel-otp
Short Description A package to generate and manage otp
License MIT
Informations about the package laravel-otp
LaravelOtp : generate OTP and Validate OTP
Table of contents
- Introduction
- Todo
- License
Introduction
LaravelOtp
is a Laravel package, designed to generate OTP and Validate OTP using simple steps. This packages will show all OTP history.
Todo
- [x] Generate OTP
- [x] Verify OTP
- [x] Methods
- [ ] OTP Lists
- [ ] Test Cases
Features
- Generate OTP
- Verify OTP
- Get the User OTP List
- Generate custom lenth, expiry and formate OTP
Installation & Configuration
You can install this package via composer using:
Next run the command below to setup api-response.config file, you can set your configuration.
Now add the use SignatureTech\LaravelOtp\Traits\Otpable
trait to your model.
Generate OTP
Please use below code to generate otp:
-
Get User Details
- Create Otp Instance
Note: You can use email/mobile/phone number to generate otp Just pass the detail using for
method.
Note: You can use more method to setting otp all methods described in methods
section.
- Attach Otp with user
Verify OTP
You can verify otp by using below code:
-
Get the use details
-
Get Otp Instance
- Verify Otp
Create OTP without model
You can also create otp without model using the following:
- Create OTP
Note: You can use email/mobile/phone number to generate otp Just pass the detail using for
method.
Note: You can use more method to setting otp all methods described in methods
section.
- Verify Otp
Methods
- Set length of otp
Note: Default length is 6 digit and you can change the default digit to add the OTP_LENGTH=4
in .env
or config/otp.php
file
- Set Format (Available Format: alpha | alphanumeric | numeric)
Note: Default format is numeric and you can change the default format to add the OTP_FORMAT=4
in .env
or config/otp.php
file
- Set Expiry (In minutes)
Note: Default expiry is 10 minutes and you can change this to add the OTP_EXPIRY=20
in .env
or config/otp.php
file
License
- Written and copyrighted ©2022 by Prem Chand Saini ([email protected])
- ResponseBuilder is open-sourced software licensed under the MIT license