Download the PHP package prasanth-j/otpify without Composer
On this page you can find all versions of the php package prasanth-j/otpify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download prasanth-j/otpify
More information about prasanth-j/otpify
Files in prasanth-j/otpify
Package otpify
Short Description Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.
License MIT
Homepage https://github.com/prasanth-j/otpify
Informations about the package otpify
Laravel Otpify 🔑
Introduction
Otpify is a Laravel package that provides a simple and elegant way to generate and validate one time passwords.
Installation
You can install the package via composer:
You can run the migrations with:
You can publish the config file with:
This is the contents of the published config file:
Optionally, you can publish the migrations using
Usage
1. Generate OTP
$identifier
: The identity (email or mobile) that will be tied to the OTP.$userId (optional | default = null)
: The user id from user table.$otpType (optional | default = null)
: The category of the OTP, like login, verification, etc.$digits (optional | default = 6)
: The amount of digits to be generated, should be 4 to 8.$validity (optional | default = 15)
: The validity period of the OTP in minutes.
Example
This will generate a six digit OTP that will be valid for 10 minutes and the success response will be:
2. Validate OTP
$identifier
: The identity (email or mobile) that will be tied to the OTP.$token
: The token tied to the identity.$otpType (optional | default = null)
: The category of the OTP, like login, verification, etc.
Example
Responses
On Success
Does not exist
On Error
Expired
Already Verified
Delete verified tokens
You can delete verified tokens by running the following artisan command:
You can also add this artisan command to app/Console/Kernel.php
to automatically clean on scheduled
Contribution
If you find an issue with this package or you have any suggestions please help out.
License
The MIT License (MIT). Please see License File for more information.
All versions of otpify with dependencies
illuminate/console Version ^9.0
illuminate/database Version ^9.0
illuminate/support Version ^9.0
nesbot/carbon Version ^2.35