Download the PHP package benbjurstrom/otpz without Composer
On this page you can find all versions of the php package benbjurstrom/otpz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download benbjurstrom/otpz
More information about benbjurstrom/otpz
Files in benbjurstrom/otpz
Package otpz
Short Description First Factor One-Time Passwords for Laravel (Passwordless OTP Login)
License MIT
Homepage https://github.com/benbjurstrom/otpz
Informations about the package otpz

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
Starter Kits
Laravel + React Starter Kit
-
New Applications
Create a new Laravel project using the OTPz + React starter kit with the following command:
- Existing Applications:
You can see a diff of all changes needed to integrate OTPz with the official Laravel + React Starter Kit here: https://github.com/laravel/react-starter-kit/compare/main...benbjurstrom:otpz-react-starter-kit:main
Laravel + Vue Starter Kit
-
New Applications
Create a new Laravel project using the OTPz + Vue starter kit with the following command:
- Existing Applications:
You can see a diff of all changes needed to integrate OTPz with the official Laravel + Vue Starter Kit here: https://github.com/laravel/vue-starter-kit/compare/main...benbjurstrom:otpz-vue-starter-kit:main
Laravel + Livewire Starter Kit
-
New Applications
Create a new Laravel project using the OTPz + Livewire starter kit with the following command:
- Existing Applications:
You can see a diff of all changes needed to integrate OTPz with the official Laravel + Livewire Starter Kit here: https://github.com/laravel/livewire-starter-kit/compare/main...benbjurstrom:otpz-livewire-starter-kit:main
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. (Optional) Add the following routes
Not needed with Laravel 12 starter kits. Instead, see the Usage section for examples.
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 With Breeze
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