Download the PHP package unrulynatives/otpz without Composer
On this page you can find all versions of the php package unrulynatives/otpz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download unrulynatives/otpz
More information about unrulynatives/otpz
Files in unrulynatives/otpz
Package otpz
Short Description Secure One-Time Passwords For Laravel
License MIT
Homepage https://github.com/benbjurstrom/otpz
Informations about the package otpz
Fork for Laravel 12 compatibility
First Factor One-Time Passwords for Laravel
This package provides secure first factor one-time passwords (OTPs) for Laravel applications. Users enter their email and receive a one-time code to sign in.
- ✅ Rate-limited
- ✅ Configurable expiration
- ✅ Invalidated after first use
- ✅ Locked to the user's session
- ✅ Invalidated after too many failed attempts
- ✅ Detailed error messages
- ✅ Customizable mail template
- ✅ Auditable logs
Installation
1. Install the package via composer:
2. Publish and run the migrations
3. Add the package's interface and trait to your Authenticatable model
4. Add the package provided routes
5. (Optional) Publish the views for custom styling
This package publishes the following views:
6. (Optional) Publish the config file
This is the contents of the published config file:
Usage
Laravel Breeze Livewire Example
- Replace the Breeze provided App\Livewire\Forms\LoginForm::authenticate method with a sendEmail method that runs the SendOtp action. Also be sure to remove password from the LoginForm's properties.
`
- Update resources/views/livewire/pages/auth/login.blade.php such that the login function calls our new sendEmail method and redirects to the OTP entry page. You can also remove the password input field in this same file.
Laravel Breeze Inertia Example
-
Replace the Breeze provided App\Http\Requests\Auth\LoginRequest::authenticate method with a sendEmail method that runs the SendOtp action. Also be sure to remove password from the rules array.
-
Update the App\Http\Controllers\Auth\AuthenticatedSessionController::store method to call our new sendEmail method and redirect to the OTP entry page.
- Remove the password input field from the resources/js/Pages/Auth/Login.vue file.
Everything else is handled by the package components.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Ben Bjurstrom
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of otpz with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0