PHPackages                             sadiqsalau/laravel-otp-password - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. sadiqsalau/laravel-otp-password

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

sadiqsalau/laravel-otp-password
===============================

OTP Password Reset Package for Laravel

v1.0.1(2y ago)2886[2 issues](https://github.com/sadiqsalau/laravel-otp-password/issues)MITPHPPHP ^8.0

Since Sep 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sadiqsalau/laravel-otp-password)[ Packagist](https://packagist.org/packages/sadiqsalau/laravel-otp-password)[ RSS](/packages/sadiqsalau-laravel-otp-password/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

Laravel OTP Password
====================

[](#laravel-otp-password)

Introduction
------------

[](#introduction)

This package makes it a breeze implementing password reset using the [sadiqsalau/laravel-otp](https://github.com/sadiqsalau/laravel-otp) package.

Installation
------------

[](#installation)

Install via composer: This package depends on [sadiqsalau/laravel-otp](https://github.com/sadiqsalau/laravel-otp), you need to install the both of them.

```
composer require sadiqsalau/laravel-otp sadiqsalau/laravel-otp-password
```

Usage
-----

[](#usage)

To use this package, you must have implemented your OTP verification system ().

### Sending Reset OTP

[](#sending-reset-otp)

Sending password reset OTP is similar to sending password reset link ().

```
use Illuminate\Http\Request;
use SadiqSalau\LaravelOtpPassword\Facades\OtpPassword;

Route::post('/forgot-password', function (Request $request) {
    $request->validate(['email' => 'required|email']);

    $status = OtpPassword::sendOTP(
        $request->only('email')
    );

    return $status === OtpPassword::OTP_SENT
                ? back()->with(['status' => __($status)])
                : back()->withErrors(['email' => __($status)]);
})->middleware('guest')->name('password.email');
```

Once the OTP has been sent, the user is expected to verify their OTP code, upon verification a password reset session would be created. This session will last for the number of minutes configured in `config/auth.php`.

```
    'passwords' => [
        'users' => [
            'provider' => 'users',
            'expire' => 15
        ],
    ],
```

### Resetting Password

[](#resetting-password)

```
use App\Models\User;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Illuminate\Validation\Rules;
use SadiqSalau\LaravelOtpPassword\Facades\OtpPassword;

Route::post('/reset-password', function (Request $request) {
    $request->validate([
        'email' => ['required', 'email'],
        'password' => ['required', 'confirmed', Rules\Password::defaults()],
    ]);

    $status = OtpPassword::reset(
        $request->only(
            'email',
            'password',
            'password_confirmation'
        ),
        function ($user) use ($request) {
            $user->forceFill([
                'password' => Hash::make($request->password),
                'remember_token' => Str::random(60),
            ])->save();

            event(new PasswordReset($user));
        }
    );

    return $status === OtpPassword::PASSWORD_RESET
                ? redirect()->route('login')->with('status', __($status))
                : back()->withErrors(['email' => [__($status)]]);
})->middleware('guest')->name('password.update');
```

API
---

[](#api)

- `OtpPassword::sendOtp(array $credentials)` - Send password reset OTP
- `OtpPassword::reset(array $credentials, Closure $callback)` - Attempt to reset the password.

Contribution
------------

[](#contribution)

Contributions are welcomed.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~189 days

Total

2

Last Release

835d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae6830113de554901d0bfa1fcc10056f3842ddf3794b9334fad037ee87c37b84?d=identicon)[sadiqsalau](/maintainers/sadiqsalau)

---

Top Contributors

[![sadiqsalau](https://avatars.githubusercontent.com/u/48159544?v=4)](https://github.com/sadiqsalau "sadiqsalau (12 commits)")

### Embed Badge

![Health badge](/badges/sadiqsalau-laravel-otp-password/health.svg)

```
[![Health](https://phpackages.com/badges/sadiqsalau-laravel-otp-password/health.svg)](https://phpackages.com/packages/sadiqsalau-laravel-otp-password)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[jeremy379/laravel-openid-connect

OpenID Connect support to the PHP League's OAuth2 Server. Compatible with Laravel Passport.

59437.0k9](/packages/jeremy379-laravel-openid-connect)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
