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(2y ago)018MITPHPPHP ^8.0

Since Jul 21Pushed 2y 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 2d 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

22

—

LowBetter than 21% of packages

Maintenance20

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

753d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/81383210?v=4)[Shyam](/maintainers/LoopLinguist)[@LoopLinguist](https://github.com/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.

9630.7M327](/packages/illuminate-encryption)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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