Description
otp is a PHP library that creates and checks one-time passwords that expire, without keeping any of them in a database. It is designed mainly as a Laravel package, and it also works in any plain PHP application. You generate a code for a unique secret, such as a user's email address, phone number or user ID, and later check the code against that same secret. The expiry time, the number of digits and the other settings are part of the check, so the same configuration must be used when generating and verifying, which stops someone from reproducing a code without knowing those settings. Installation uses Composer. In Laravel you publish a configuration file, then use a facade or a helper function to generate and match codes. The library suits sign-in checks, email confirmations and other short-lived codes where you do not want a table of issued passwords. It is a developer library rather than an end-user app, so your own code must send the code to the user and handle what happens after it is entered.…
Highlights
- Generates one-time codes that expire
- No database table needed for issued codes
- Laravel facade and helper function
- Works in any PHP app, installed with Composer
- Verification needs the same settings as generation
Ratings & Reviews
No ratings yet
Be the first to rate Otp.
People also visit
Otpauth
Implements two-step verification of HOTP/TOTP. Also known as one time password
Otp FAQ
What does this package do?
It generates one-time passwords that expire after a set time and checks them against a secret, without writing them to a database.
Do I need a database?
No. A code is checked from the secret and its settings, so there is no table of issued OTPs to maintain.
Does it work outside Laravel?
Yes. Install it with Composer and use it in any PHP application. The Laravel facade and helper are optional.
How do I install it?
Install the package with Composer. In Laravel, publish the configuration file afterwards if you want to change the defaults.
Is the source public?
Yes. The package is published on GitHub, where its usage examples and options are documented.
What are the best Otp alternatives?
Popular alternatives to Otp include FreeOTP, Zero-TOTP and Vemto. See all Otp alternatives

