Download the PHP package alish/laravel-otp without Composer
On this page you can find all versions of the php package alish/laravel-otp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alish/laravel-otp
More information about alish/laravel-otp
Files in alish/laravel-otp
Package laravel-otp
Short Description My awesome package
License MIT
Homepage https://github.com/alish/laravel-otp
Informations about the package laravel-otp
Laravel Module to Facilitate the One-Time Password Authentication
One-Time Password Authentication has gained noticeable popularity amongst software developers, due to its reliablity and ease of use. Using this module, you are able to embedd OTP to your Laravel project in a considerably straightforward manner. This Package is equipped with both Cache and Database drivers to provide developers with the freedom of choice, regarding the unit supposed to hold the OTP and other related information.
Installation
You can install the package via composer:
Usage
for issuing new token for specific key:
to revoke token for specific key you can use:
to check token against key:
if you want to use otp generated token (it means check provided key, token then revoke if it matches) you can:
Keep in mind that if database driver is your preferred choice, you are supposed to publish migrations file first:
then run your migrations with
In order to be able to adjust the configuration of this package, you are supposed to publish your configurations using the following command:
-
default: Using this value, you are able to modify the default method to store the OTP and other related information.
-
type: This variable determines the type of the characters included in the OTP. Choices are alpha, alphanumeric, numeric and strong (include special characters).
-
length: By changing this variable, you are able to determine the number of the characters that OTP has.
-
case-sensitive: Using this variable, you are able to control the sensitivity of the package to case sensitivity.
-
custom': Pass the set of the characters you want to create your custom OTPs from as a simple string (eg: "1234") to this variable.
-
timeout: This variable determines the time (in seconds), which the token is active to use. To set a token active permenantly, set timeout to null.
-
hash: Using this variable, you are able to determine if the token should be hashed or not.
- unique: Using this variable, you are able to revoke all generated tokens after creating a new one, for a specific key. This functionality is only available for Database Driver.
Testing
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Ali Shabani
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.