PHPackages                             ejklock/laravel-nist-password-rules - 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. ejklock/laravel-nist-password-rules

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

ejklock/laravel-nist-password-rules
===================================

🔒 Provides Laravel validation rules that follow the password related recommendations found in NIST Special Publication 800-63B.

v8.0.0(1y ago)011LGPL-3.0-onlyPHPPHP &gt;=7.2

Since Oct 31Pushed 1y agoCompare

[ Source](https://github.com/ejklock/laravel-nist-password-rules)[ Packagist](https://packagist.org/packages/ejklock/laravel-nist-password-rules)[ RSS](/packages/ejklock-laravel-nist-password-rules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (23)Used By (0)

🔒 Laravel NIST Password Rules
=============================

[](#-laravel-nist-password-rules)

[![Build Status](https://camo.githubusercontent.com/bf69060672c1c5a826c5b40832a9e8886cde9b6ed020cd3705f696b2bdcb65f1/68747470733a2f2f7472617669732d63692e6f72672f6c616e676c6579666f78616c6c2f6c61726176656c2d6e6973742d70617373776f72642d72756c65732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/langleyfoxall/laravel-nist-password-rules)[![Coverage Status](https://camo.githubusercontent.com/831049714522c94566da3018fca8e19ec6350c0bf9efc8a1c9a0038352462fea/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c616e676c6579666f78616c6c2f6c61726176656c2d6e6973742d70617373776f72642d72756c65732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/langleyfoxall/laravel-nist-password-rules?branch=master)[![StyleCI](https://camo.githubusercontent.com/01845bc70fca40082f4f19c6eaa0a6c3d01e3f2ee40e7e08230218961f89a15e/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135343835333038322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/154853082)[![Packagist](https://camo.githubusercontent.com/6b3b53c92fb17bc35e6eab8e2d1f016c83bc798b6efeef1873334dd00ce2eaff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c616e676c6579666f78616c6c2f6c61726176656c2d6e6973742d70617373776f72642d72756c65732e737667)](https://packagist.org/packages/langleyfoxall/laravel-nist-password-rules/stats)

This package provides Laravel validation rules that follow the password related recommendations found in [NIST Special Publication 800-63B section 5](https://pages.nist.gov/800-63-3/sp800-63b.html#sec5).

Laravel NIST Password Rules implements the following recommendations.

RecommendationImplementation\[...\] at least 8 characters in lengthA standard validation rule in all rule sets to validate against this minimum length of 8 characters.Passwords obtained from previous breach corpusesThe `BreachedPasswords` rule securely checks the password against previous 3rd party data breaches, using the [Have I Been Pwned - Pwned Passwords](https://haveibeenpwned.com/Passwords) API.Dictionary wordsThe `DictionaryWords` rule checks the password against a list of over 102k dictionary words.Context-specific words, such as the name of the service, the usernameThe `ContextSpecificWords` rule checks the password does not contain the provided username, and any words defined the configured app name or app URL.Context-specific words, \[...\] and derivatives thereofThe `DerivativesOfContextSpecificWords` rule checks the password is not too similar to the provided username, and any words defined the configured app name or app URL.Repetitive or sequential characters (e.g. ‘aaaaaa’, ‘1234abcd’)The `RepetitiveCharacters` and `SequentialCharacters` rules checks if the password consists of only repetitive or sequential characters.It also provides methods to return validation rules arrays for various scenarios, such as register, login, and password changes. These arrays can be passed directly into the Laravel validator.

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

[](#installation)

Laravel NIST Password Rules can be easily installed using Composer. Just run the following command from the root of your project.

```
composer require langleyfoxall/laravel-nist-password-rules
```

If you have never used the Composer dependency manager before, head to the Composer website for more information on how to get started.

Optionally, you may publish the package's translation files with the following Artisan command.

```
php artisan vendor:publish --provider="LangleyFoxall\LaravelNISTPasswordRules\ServiceProvider"
```

Usage
-----

[](#usage)

To use the Laravel NIST Password Rules in your project, first `use` the `PasswordRules` class, then call the appropriate static methods to return an array of appropriate validation rules. There are methods available for the following scenerios.

- Register
- Change password, with old password
- Change password, without old password
- Optionally change password, with old password
- Optionally change password, without old password
- Login

See the code below for example usage syntax.

```
use LangleyFoxall\LaravelNISTPasswordRules\PasswordRules;

// Register
$this->validate($request, [
    'email' => 'required',
    'password' => PasswordRules::register($request->email),
]);

// Register, without requiring password confirmation
$this->validate($request, [
    'email' => 'required',
    'password' => PasswordRules::register($request->email, false),
]);

// Change password, with old password
$this->validate($request, [
    'old_password' => 'required',
    'password' => PasswordRules::changePassword($request->email, 'old_password'),
]);

// Change password, without old password
$this->validate($request, [
    'password' => PasswordRules::changePassword($request->email),
]);

// Optionally change password, with old password
$this->validate($request, [
    'old_password' => 'required',
    'password' => PasswordRules::optionallyChangePassword($request->email, 'old_password'),
]);

// Optionally change password, without old password
$this->validate($request, [
    'password' => PasswordRules::optionallyChangePassword($request->email),
]);

// Login
$this->validate($request, [
    'email' => 'required',
    'password' => PasswordRules::login(),
]);
```

The `optionallyChangePassword` method supplies validation rules that are appropriate for forms in which the password can be optionally changed if filled in.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance42

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 81.1% 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 ~115 days

Recently: every ~283 days

Total

19

Last Release

679d ago

Major Versions

v2.0.0 → v3.0.02019-05-30

v3.0.0 → v4.0.02019-07-03

v4.4.1 → v5.0.02021-04-20

v5.0.1 → v6.0.02022-05-16

v6.2.0 → v8.0.02024-07-03

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v5.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/80513b563269223b378c10f659c199d4e79f5491b80a1c08afe94f11547aa7be?d=identicon)[ejklock](/maintainers/ejklock)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (99 commits)")[![jameswilddev](https://avatars.githubusercontent.com/u/3138458?v=4)](https://github.com/jameswilddev "jameswilddev (11 commits)")[![SteJaySulli](https://avatars.githubusercontent.com/u/60765965?v=4)](https://github.com/SteJaySulli "SteJaySulli (5 commits)")[![LNCH](https://avatars.githubusercontent.com/u/10821244?v=4)](https://github.com/LNCH "LNCH (3 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![Warren-CB](https://avatars.githubusercontent.com/u/126696209?v=4)](https://github.com/Warren-CB "Warren-CB (1 commits)")[![ziming](https://avatars.githubusercontent.com/u/679513?v=4)](https://github.com/ziming "ziming (1 commits)")

### Embed Badge

![Health badge](/badges/ejklock-laravel-nist-password-rules/health.svg)

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

###  Alternatives

[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1036.7k3](/packages/carsdotcom-laravel-json-schema)

PHPackages © 2026

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