PHPackages                             devlop/secure-password-rule - 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. devlop/secure-password-rule

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

devlop/secure-password-rule
===========================

Extendable SecurePassword rule for Laravel

1.0.1(5y ago)014MITPHPPHP ^7.4|^8.0

Since Feb 6Pushed 5y ago1 watchersCompare

[ Source](https://github.com/devlop/secure-password-rule)[ Packagist](https://packagist.org/packages/devlop/secure-password-rule)[ RSS](/packages/devlop-secure-password-rule/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

 [![Latest Stable Version](https://camo.githubusercontent.com/472219df3c3a845298ed8fae5637d139aea287a2ca2a0435d09b2a7bcbcd1f3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6465766c6f702f7365637572652d70617373776f72642d72756c65)](https://packagist.org/packages/devlop/secure-password-rule) [![License](https://camo.githubusercontent.com/cd663faf7906404d1d942e4bac0d0917504ab3ddd17cda4d1e16637b17165b2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6465766c6f702f7365637572652d70617373776f72642d72756c65)](https://github.com/devlop/secure-password-rule/blob/master/LICENSE.md)

SecurePasswordRule
==================

[](#securepasswordrule)

An extendable password validation rule for Laravel to make it easy to have the same password requirements across the whole system.

The initial settings are very permissive and pretty much only checks the length of the password, see `Configuration` for how to change it for your needs.

Installation
============

[](#installation)

```
composer require devlop/secure-password-rule
```

Usage
=====

[](#usage)

Add it to the `rules` of a `FormRequest`

```
namespace App\Http\Requests;

use Devlop\SecurePasswordRule\SecurePasswordRule;
use Illuminate\Foundation\Http\FormRequest;

class ChangePasswordRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'new_password' => [
                'required',
                'string',
                new SecurePasswordRule,
            ],
        ];
    }
}
```

Configuration
=============

[](#configuration)

The class is open for extension and does not accept any arguments when instantiating since that would open the possibility of ending up with different password requirements in different parts of your system.

The recommended way is to create your own sub class of SecurePasswordRule and change the parameters you wish to change, and then reference that sub class instead in your FormRequests.

```
namespace App\Rules;

use Devlop\SecurePasswordRule\SecurePasswordRule as BaseSecurePasswordRule;

class SecurePasswordRule extends BaseSecurePasswordRule
{
    /**
     * Require the use of X special characters
     */
    protected int $requireSpecial = 10;
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~26 days

Total

2

Last Release

1947d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10432296?v=4)[Johan Rosenson](/maintainers/johanrosenson)[@johanrosenson](https://github.com/johanrosenson)

---

Top Contributors

[![johanrosenson](https://avatars.githubusercontent.com/u/10432296?v=4)](https://github.com/johanrosenson "johanrosenson (3 commits)")

---

Tags

laravelvalidationvalidation-rule

### Embed Badge

![Health badge](/badges/devlop-secure-password-rule/health.svg)

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

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3416.9k](/packages/duncanmcclean-statamic-cargo)[carsdotcom/laravel-json-schema

Json Schema validation for Laravel projects

1043.3k6](/packages/carsdotcom-laravel-json-schema)

PHPackages © 2026

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