PHPackages                             ddtech/laravel-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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. ddtech/laravel-password-policy

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

ddtech/laravel-password-policy
==============================

Associate password policy with Eloquent models

03PHP

Since Oct 20Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Password Policy
=======================

[](#laravel-password-policy)

This package ensures that the last used (n) password/s are not entered.

Requirements
------------

[](#requirements)

Laravel Fortify or Jetstream has to be installed.

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

[](#installation)

```
composer require ddtech/laravel-password-policy
```

```
php artisan vendor:publish --tag=migrations
php artisan migrate
```

Usage
-----

[](#usage)

Add PasswordRecords Traits to User Model

```
use PasswordRecords;

```

You need to change Fortify, ResetUserPassword's reset function

```
Validator::make($input, [
  'password' => $this->passwordRules(),
])->validate();

```

```
Validator::make($input, [
    'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) {
    $user->oldPasswordRules($validator, $user, $input, 3);
})->validate();

$user->triggerPasswordRecord($user->password);

```

You need to change Fortify, UpdateUserPassword's update function

```
Validator::make($input, [
    'current_password' => ['required', 'string'],
    'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) {
    if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) {
        $validator->errors()->add('current_password', __('The provided password does not match your current password.'));
    }
})->validateWithBag('updatePassword');

```

```
Validator::make($input, [
    'current_password' => ['required', 'string'],
    'password' => $this->passwordRules(),
])->after(function ($validator) use ($user, $input) {
    if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) {
        $validator->errors()->add('current_password', __('The provided password does not match your current password.'));
    }
    $user->oldPasswordRules($validator, $user, $input, 3);
})->validateWithBag('updatePassword');

$user->triggerPasswordRecord($user->password);

```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![muhammedsaidckr](https://avatars.githubusercontent.com/u/35296868?v=4)](https://github.com/muhammedsaidckr "muhammedsaidckr (2 commits)")

### Embed Badge

![Health badge](/badges/ddtech-laravel-password-policy/health.svg)

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

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M105](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M450](/packages/nette-forms)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)

PHPackages © 2026

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