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)2762[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 1mo ago

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

21

—

LowBetter than 19% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

783d 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

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[codegreencreative/laravel-samlidp

Make your PHP Laravel application an Identification Provider using SAML 2.0. This package allows you to implement your own Identification Provider (idP) using the SAML 2.0 standard to be used with supporting SAML 2.0 Service Providers (SP).

263763.5k1](/packages/codegreencreative-laravel-samlidp)

PHPackages © 2026

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