PHPackages                             schwarzer/laravel-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. schwarzer/laravel-rules

Abandoned → [laravel/framework](/?search=laravel%2Fframework)Library[Validation &amp; Sanitization](/categories/validation)

schwarzer/laravel-rules
=======================

Laravel Rules

1.4.0(yesterday)1431[1 PRs](https://github.com/SchwarzerIT/laravel-rules/pulls)MITPHPPHP ^8.3

Since Oct 12Pushed 5y ago2 watchersCompare

[ Source](https://github.com/SchwarzerIT/laravel-rules)[ Packagist](https://packagist.org/packages/schwarzer/laravel-rules)[ Docs](https://github.com/SchwarzerIT/laravel-rules)[ RSS](/packages/schwarzer-laravel-rules/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (12)Versions (6)Used By (0)

Laravel Rules Package
=====================

[](#laravel-rules-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/18f32d9c30b37e88f1c510f8b125418e7de1fefe823fee136b24de1def0d7704/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7363687761727a65722f6c61726176656c2d72756c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/schwarzer/laravel-rules)[![Build Status](https://camo.githubusercontent.com/c9cc159bf7b6b27c88a1ae2fef11d0a3694d71ff24e4588aae22bdee4b2cf75c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5363687761727a657249542f6c61726176656c2d72756c65732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/github/SchwarzerIT/laravel-rules)[![Code Coverage](https://camo.githubusercontent.com/f9e200cee261cde542c9ce003c91b1d4fe0d84a555bf87c20562529fe4f1497e/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f5363687761727a657249542f6c61726176656c2d72756c65733f7374796c653d666c61742d737175617265)](https://coveralls.io/github/SchwarzerIT/laravel-rules)[![Total Downloads](https://camo.githubusercontent.com/b9abaec77a8f9113acfc0cc17ac44b5efb5657021682ed29d03a0958f163e42d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7363687761727a65722f6c61726176656c2d72756c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/schwarzer/laravel-rules)[![License](https://camo.githubusercontent.com/b489ddc7bdb3a156face301f5776c72b7afaa3d66033eb923a11b5bdce7fb4b4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5363687761727a657249542f6c61726176656c2d72756c65733f7374796c653d666c61742d737175617265)](https://github.com/SchwarzerIT/laravel-rules/blob/master/LICENSE.md)

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

[](#installation)

You can install the package via composer:

```
composer require schwarzer/laravel-rules
```

Usage
-----

[](#usage)

Please consider reading the [Laravel Docs](https://laravel.com/docs/8.x/validation) first.

### Have I Been Pwned

[](#have-i-been-pwned)

[haveibeenpwned.com API v3](https://haveibeenpwned.com/API/v3)

In the next major release you'll be able to set the API key by config.

*This rule is inspired by valorin/pwned-validator.*

#### Translation

[](#translation)

Please add to your `/resources/lang/{lang}/validation.php` file the following line:

##### English

[](#english)

```
    'hibp' => 'The :attribute occurs at least :min times in a list of known passwords.',

```

##### Deutsch

[](#deutsch)

```
    'hibp' => 'Das :attribute kommt mindestens :min mal in einer Liste bekannter Passwörter vor.',

```

#### Short syntax

[](#short-syntax)

```
Validator::make($request->all(), [
    'password' => 'required|hibp',
]);
```

You can specify how often your password (hash) should be found `min`imum in the [HIBP](https://haveibeenpwned.com/) results.

```
Validator::make($request->all(), [
    'password' => 'required|hibp:min=1',
]);
```

#### Class / Object syntax

[](#class--object-syntax)

```
Validator::make($request->all(), [
    'password' => ['required', new HaveIBeenPwned],
]);
```

You can specify how often your password (hash) should be found minimum in the [HIBP](https://haveibeenpwned.com/) results.

```
Validator::make($request->all(), [
    'password' => ['required', new HaveIBeenPwned(1)],
]);
```

Testing
-------

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~508 days

Total

5

Last Release

1d ago

PHP version history (3 changes)1.0.0PHP ^7.4

1.2.0PHP ^7.4|^8.0

1.4.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/7b7fd6e79dc5e46a9019916ae9f637392fe5bd8e5af82ab7d07d551cdd5aaf6d?d=identicon)[Schwarzer IT](/maintainers/Schwarzer%20IT)

---

Top Contributors

[![AndreSchwarzer](https://avatars.githubusercontent.com/u/6991100?v=4)](https://github.com/AndreSchwarzer "AndreSchwarzer (10 commits)")

---

Tags

laravelruleschwarzer

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/schwarzer-laravel-rules/health.svg)

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

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)[timacdonald/rule-builder

A fluent rule builder for Laravel validation rule generation.

1027.7k](/packages/timacdonald-rule-builder)

PHPackages © 2026

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