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

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

dilneiss/laravel-nist-password-rules
====================================

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

6.4(1y ago)13.2k↓50%LGPL-3.0-onlyPHPPHP &gt;=7.2

Since Dec 19Pushed 1y agoCompare

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

READMEChangelog (4)Dependencies (5)Versions (5)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

28

—

LowBetter than 54% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.5% 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 ~54 days

Total

4

Last Release

720d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/339a3fb5132ca6fdf590eb87aaf69c97a45b1980dc3bb7109b89b531c56b4d62?d=identicon)[dilneiss](/maintainers/dilneiss)

---

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 (6 commits)")[![SteJaySulli](https://avatars.githubusercontent.com/u/60765965?v=4)](https://github.com/SteJaySulli "SteJaySulli (5 commits)")[![dilneiss](https://avatars.githubusercontent.com/u/4564667?v=4)](https://github.com/dilneiss "dilneiss (4 commits)")[![LNCH](https://avatars.githubusercontent.com/u/10821244?v=4)](https://github.com/LNCH "LNCH (3 commits)")[![ziming](https://avatars.githubusercontent.com/u/679513?v=4)](https://github.com/ziming "ziming (1 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/dilneiss-laravel-nist-password-rules/health.svg)](https://phpackages.com/packages/dilneiss-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)
