salehhashemi/laravel-otp-manager
Laravel OTP Manager provides a simple, secure way to generate, send, and verify one-time passwords in Laravel applications. It supports multiple delivery channels, configurable expiry, rate limiting, and middleware to protect routes and actions with minimal setup.
Architecture fit
HasOtp-style) is the standard shape for this class of package. It slots into the container and the existing User model without requiring a parallel auth system.OtpService interface that the package implements behind. That keeps the package an implementation detail and makes an exit cheap.Integration feasibility
composer require, publish config + migration, add the trait to User, configure TTL/length/resend cooldown, bind an SMS channel, wrap in the internal service. A competent Laravel engineer validates a POC in one to two days.Technical risk
Key questions to answer in the spike
hash_equals/constant-time comparison?lockForUpdate) or is there a check-then-act race?composer.json or just implied by CI?OtpGenerated, OtpVerified, OtpFailed) so we can wire metrics and anomaly alerting without patching?Stack fit
Migration path
OtpService adapter and route one low-risk journey through it — phone verification at signup is the right first target. Never start with password reset or login 2FA.Compatibility
composer.lock. Adopt with a policy of "pin, monitor, fork on abandonment."otp_codes/verification_codes table and with any package that also owns a HasOtp trait name.Sequencing
Audit → POC → vendor risk gate → internal adapter → single journey in staging → canary → broaden → decommission legacy. Roughly one sprint for a single-engineer effort through staging; the security review is the schedule risk, not the code.
Maintenance
Support
OtpService, which is the correct ownership boundary.Scaling
created_at is mandatory; without it, verification degrades as the table grows.Failure modes
Ramp-up
How can I help you explore Laravel packages today?