Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Otp

Laravel Otp Laravel Package

erdemkeren/laravel-otp

A Laravel package for one-time password authentication. It generates and verifies short-lived OTP codes with configurable expiry, token length, and storage, making it easy to add secure OTP flows to login, registration, or sensitive actions.

View on GitHub
Deep Wiki
Context7

A laravel package to protect your routes with one time passwords (otp)

Frequently asked questions about Laravel Otp
How do I install erdemkeren/laravel-otp?
Install it with Composer using composer require erdemkeren/laravel-otp. The package is Laravel-native and uses service-provider registration, so you will typically publish its configuration and any migrations, then attach its middleware to the routes you want to protect. Confirm Composer dependency compatibility with your Laravel and PHP versions before installing in a production app.
Which Laravel and PHP versions are supported by laravel-otp?
The package is described as a Laravel 8-era package and its last release was on 2021-08-04, so official support for newer Laravel versions is uncertain. You should run composer why-not against your target Laravel and PHP versions to verify compatibility. Laravel 9, 10, and 11 projects should expect possible dependency constraints and may need a maintained fork or application-level extraction.
How does laravel-otp protect Laravel routes?
It provides route-level OTP protection through Laravel middleware, so you can gate selected route groups behind an OTP challenge and verification flow. Typical uses include sensitive actions, phone or email verification, and internal admin routes. It is an accelerator for OTP challenge and verify flows, not a complete authentication or identity platform.
Can I configure OTP expiry, token length, and storage in laravel-otp?
Yes, the package is described as generating and verifying short-lived OTP codes with configurable expiry, token length, and storage. You will typically publish the config file and adjust those values for your flow. Review the storage and cleanup strategy before using it with production data.
Is laravel-otp safe for customer-facing login or password reset?
The technical evaluation warns that this is a security-sensitive package with limited recent maintenance, so it should not be adopted for customer-facing authentication without a security review and dependency audit. It may be adequate for low-risk internal flows, but high-assurance login or password reset requires careful validation of expiry, replay prevention, rate limiting, storage hashing, user or session binding, and enumeration protection. Start with a non-critical route group rather than customer login.
Does laravel-otp work with API routes and return JSON?
The package is aimed at Laravel route middleware, and the evaluation notes that API support depends on the middleware response behavior and token binding. You need to validate whether it returns usable JSON for APIs or only redirects for web routes. API-only or stateless architectures need extra design for device or session association and JSON error contracts.
Does laravel-otp include rate limiting and resend throttling?
The evaluation identifies rate limits, lockouts, and resend cooldowns as key security questions that must be verified in the package. Do not assume these controls are built in just because the package handles OTP generation and verification. Test the full generate-send-verify-expire-resend-lockout cycle before relying on it in production.
Are OTP codes in laravel-otp stored hashed and single-use?
The evaluation flags OTP storage hashing, single-use enforcement, time bounds, and user or session scoping as essential security properties to confirm. The package metadata alone does not prove those guarantees. You should inspect the implementation and run security-focused tests before using it for sensitive flows.
Is erdemkeren/laravel-otp actively maintained?
The package has 158 stars, scores 3.49 overall, and its last release was on 2021-08-04, which signals limited recent ecosystem momentum. MIT licensing is favorable, but maintenance, test coverage, and Laravel upgrade posture are unproven from the package metadata. For long-term use, plan to fork or vendor the middleware and service if the maintainer is not responsive.
Should I fork laravel-otp for Laravel 10 or Laravel 11?
For Laravel 10 or 11, plan for a fork or replacement unless compatibility is explicitly proven. You can fork the package under an internal namespace or copy the minimal middleware and service into your application. Laravel Fortify or custom middleware plus notifications are viable replacements if adoption becomes risky.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager