PHPackages                             swatty007/laravel-context-prohibited-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. swatty007/laravel-context-prohibited-rule

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

swatty007/laravel-context-prohibited-rule
=========================================

Simple validation rule to disallow application related words within passwords.

3.0.0(11mo ago)01.7kMITPHPPHP ^8.2CI passing

Since Feb 18Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/swatty007/laravel-context-prohibited-rule)[ Packagist](https://packagist.org/packages/swatty007/laravel-context-prohibited-rule)[ Docs](https://github.com/swatty007/laravel-context-prohibited-rule)[ RSS](/packages/swatty007-laravel-context-prohibited-rule/feed)WikiDiscussions main Synced 1w ago

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

Context prohibited validation rule for Laravel
==============================================

[](#context-prohibited-validation-rule-for-laravel)

[![Package Banner](./docs/banner.png "Package Banner")](./docs/banner.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b5f9dbb5320c285593f7fe7df7976921900628ae6055e5ea38418fb64f46f140/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7377617474793030372f6c61726176656c2d636f6e746578742d70726f686962697465642d72756c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swatty007/laravel-context-prohibited-rule)[![License: MIT](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)[![Build Status](https://github.com/swatty007/laravel-context-prohibited-rule/actions/workflows/run-tests.yaml/badge.svg)](https://github.com/swatty007/laravel-context-prohibited-rule/actions/workflows/run-tests.yaml)[![Code Style](https://github.com/swatty007/laravel-context-prohibited-rule/actions/workflows/check-coding-standards.yaml/badge.svg)](https://github.com/swatty007/laravel-context-prohibited-rule/actions/workflows/check-coding-standards.yaml)[![Quality Score](https://camo.githubusercontent.com/86c055e5c0bd6c758f351549d1c052001871b198c875d39c2f758b85f5ea3202/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7377617474793030372f6c61726176656c2d636f6e746578742d70726f686962697465642d72756c652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/swatty007/laravel-context-prohibited-rule)[![Total Downloads](https://camo.githubusercontent.com/ee62f75cb81653d1af5372bed355bb03de523a10962cdc2a07018e6fe2fd7927/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7377617474793030372f6c61726176656c2d636f6e746578742d70726f686962697465642d72756c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swatty007/laravel-context-prohibited-rule)

Simple validation rule to disallow application related words within passwords. Its checks that the entered data does not contain your application name, or url to prevent users weakening their passwords.

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

[](#installation)

You can install the package via composer:

```
composer require swatty007/laravel-context-prohibited-rule
```

Laravel's service provider discovery will automatically configure our service provider for you.

Add the validation message to your validation lang file:

For each language add a validation message to **validation.php** like below

```
'context_prohibited' => 'Your :attribute shall not contain any of the following words: :prohibited',
```

Configuration
-------------

[](#configuration)

After installing the package you can publish the configuration file via:

```
php artisan vendor:publish --provider="Swatty007\LaravelContextProhibitedRule\ContextProhibitedServiceProvider"
```

It contains some optional configuration parameters and is fully documented.

Usage
-----

[](#usage)

After installation, the `php context_prohibited ` validator will be available for use directly in your validation rules.

```
'password' => 'context_prohibited'
// or preferred
'password' => ['required', new ContextProhibited],
```

> For error message to work correctly you should prefer to initialize the rule object!

Within the context of a registration form, it would look like this:

```
return Validator::make($data, [
    'name' => 'required|string|max:255',
    'email' => 'required|string|email|max:255|unique:users',
    'password' => 'required|string|min:8|context_prohibited|confirmed',
]);
```

### Testing

[](#testing)

Yes we do!

```
composer test
```

### Changelog

[](#changelog)

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

TODO
----

[](#todo)

- Currently None

Pull Requests are welcome 🧐

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Martin Niehoff](https://github.com/swatty007)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance52

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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

Total

3

Last Release

339d ago

Major Versions

1.0.0 → 2.0.02023-09-26

2.0.0 → 3.0.02025-06-13

PHP version history (3 changes)1.0.0PHP ^7.4|^8.0

2.0.0PHP ^8.1

3.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/77f0b9661afdeab758f22b28bd1967aed025aa0e6a68fd6497b2195253ba1d4d?d=identicon)[swatty](/maintainers/swatty)

---

Top Contributors

[![swatty007](https://avatars.githubusercontent.com/u/38767638?v=4)](https://github.com/swatty007 "swatty007 (20 commits)")

---

Tags

laravelvalidationpasswordruleswatty007laravel-context-prohibited-rule

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/swatty007-laravel-context-prohibited-rule/health.svg)

```
[![Health](https://phpackages.com/badges/swatty007-laravel-context-prohibited-rule/health.svg)](https://phpackages.com/packages/swatty007-laravel-context-prohibited-rule)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[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)[schuppo/password-strength

This package provides a validator for ensuring strong passwords in Laravel 4 applications.

1432.7M1](/packages/schuppo-password-strength)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)

PHPackages © 2026

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