PHPackages                             looplinguist/secure-password-policy - 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. [Security](/categories/security)
4. /
5. looplinguist/secure-password-policy

ActiveLibrary[Security](/categories/security)

looplinguist/secure-password-policy
===================================

This is used to prevent the use of previously used passwords in Laravel.

v1.0.1(1y ago)018MITPHPPHP ^8.0

Since Jul 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/LoopLinguist/secure-password-policy)[ Packagist](https://packagist.org/packages/looplinguist/secure-password-policy)[ Docs](https://github.com/LoopLinguist/secure-password-policy)[ RSS](/packages/looplinguist-secure-password-policy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Laravel Secure Passwords Policy
===============================

[](#laravel-secure-passwords-policy)

This is used to prevent the use of previously used passwords for Laravel.

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

[](#installation)

Install using [Composer](https://getcomposer.org)

```
composer require looplinguist/secure-password-policy
```

#### User model

[](#user-model)

Update the User model to define a relationship with the password\_histories table. You can add the following code to the User model:

```
use Illuminate\Database\Eloquent\Relations\HasMany;
use LoopLinguist\SecurePasswordPolicy\Models\PasswordHistory;

class User extends Authenticatable
{
    //  ...

    public function passwordHistories(): HasMany
    {
        return $this->hasMany(PasswordHistory::class);
    }
}
```

#### Method

[](#method)

Add the following code to the method that handles password changes:

```
use LoopLinguist\SecurePasswordPolicy\Http\HasPasswordHistory;

 if ((new HasPasswordHistory($request->input('password')))->hasHistory()) {
            return response()->json([
                'message' => 'Password found.'
            ], 409);
        }
```

Publish the config file with:

```
php artisan vendor:publish --tag=secure-password-policy-config
```

This is the content of the file that will be published in config/secure-password-policy.php

Publish the migrations with:

```
php artisan vendor:publish --tag=secure-password-policy-migrations
```

```
php artisan migrate
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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 ~325 days

Total

2

Last Release

701d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ee04817d0e7aee75d4b7421645ca57442801ce8c7a1cf410b8d9033d19fe185?d=identicon)[LoopLinguist](/maintainers/LoopLinguist)

---

Tags

looplinguistsecure-password-policy

### Embed Badge

![Health badge](/badges/looplinguist-secure-password-policy/health.svg)

```
[![Health](https://phpackages.com/badges/looplinguist-secure-password-policy/health.svg)](https://phpackages.com/packages/looplinguist-secure-password-policy)
```

###  Alternatives

[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[genealabs/laravel-governor

Managing policy and control in Laravel.

201262.8k](/packages/genealabs-laravel-governor)[dgtlss/warden

A Laravel package that proactively monitors your dependencies for security vulnerabilities by running automated composer audits and sending notifications via webhooks and email

8745.6k](/packages/dgtlss-warden)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)[laragear/poke

Keep your forms alive, avoid TokenMismatchException by gently poking your Laravel app

2211.5k](/packages/laragear-poke)

PHPackages © 2026

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