Download the PHP package bonabrian/laravel-otp without Composer
On this page you can find all versions of the php package bonabrian/laravel-otp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download bonabrian/laravel-otp
More information about bonabrian/laravel-otp
Files in bonabrian/laravel-otp
Download bonabrian/laravel-otp
More information about bonabrian/laravel-otp
Files in bonabrian/laravel-otp
Vendor bonabrian
Package laravel-otp
Short Description Laravel OTP generator and validator without using database
License MIT
Homepage https://github.com/bonabrian/laravel-otp
Package laravel-otp
Short Description Laravel OTP generator and validator without using database
License MIT
Homepage https://github.com/bonabrian/laravel-otp
Please rate this library. Is it a good library?
Informations about the package laravel-otp
OTP Generator & Validator
Installation
Via Composer
To publish the config file for laravel
Usage in Laravel
Import the facade class
Generate an OTP:
The generated OTP above will only be validated using the same secret within the default expiry time.
TIP: OTP is generally used for verification. So the easiest way of determining the
secret
is the user's email/username or phone number or maybe user ID.
Validate an OTP:
Other Generate & Validate options:
Make sure to set the same config during validating. Example:
// Example 1
Otp::validate($code, $secret); // false
Otp::setDigits(4)->validate($code, $secret); // true
// Example 2
Otp::validate($code, $secret); // false
Otp::setExpiry(30)->validate($codde, $secret); // true
// Example 3
Otp::validate($code, $secret); // false
Otp::setDigits(4)->setExpiry(30)->validate($code, $secret); // true
All versions of laravel-otp with dependencies
PHP Build Version
Package Version
The package bonabrian/laravel-otp contains the following files
Loading the files please wait ....