PHPackages                             jonpurvis/squeaky - 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. [Framework](/categories/framework)
4. /
5. jonpurvis/squeaky

ActiveLibrary[Framework](/categories/framework)

jonpurvis/squeaky
=================

A Laravel Validation Rule to Help Catch Profanity.

v2.4.0(1mo ago)706.0k↑29.6%5MITPHPPHP ^8.3CI passing

Since Feb 28Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/JonPurvis/squeaky)[ Packagist](https://packagist.org/packages/jonpurvis/squeaky)[ Docs](https://github.com/jonpurvis/squeaky)[ RSS](/packages/jonpurvis-squeaky/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (28)Versions (16)Used By (0)

[![](art/banner.png)](art/banner.png)

Squeaky
=======

[](#squeaky)

A Laravel Validation Rule that helps catch profanity in your application.

[![Tests](https://github.com/JonPurvis/squeaky/actions/workflows/tests.yml/badge.svg)](https://github.com/JonPurvis/squeaky/actions/workflows/tests.yml)[![GitHub last commit](https://camo.githubusercontent.com/e74c8bab341eddc0304ea79a0a689797aa9ab46c91791e01c6ea2d807f2add58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6a6f6e7075727669732f73717565616b79)](https://camo.githubusercontent.com/e74c8bab341eddc0304ea79a0a689797aa9ab46c91791e01c6ea2d807f2add58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6a6f6e7075727669732f73717565616b79)[![Packagist PHP Version](https://camo.githubusercontent.com/2c2caad251ad067539fd69606b43472d97c1997660e17317950eb4070ca623de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6a6f6e7075727669732f73717565616b792f706870)](https://camo.githubusercontent.com/2c2caad251ad067539fd69606b43472d97c1997660e17317950eb4070ca623de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6a6f6e7075727669732f73717565616b792f706870)[![GitHub issues](https://camo.githubusercontent.com/760862d55f0db53c83d6237fc9eede237191e5955287ecc72ffbd6e69d4de8f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6a6f6e7075727669732f73717565616b79)](https://camo.githubusercontent.com/760862d55f0db53c83d6237fc9eede237191e5955287ecc72ffbd6e69d4de8f1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6a6f6e7075727669732f73717565616b79)[![GitHub](https://camo.githubusercontent.com/72e95ebd0dcca5241415344b426fc359ceb5f8b72a590829352f7844b71febb3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f6e7075727669732f73717565616b79)](https://camo.githubusercontent.com/72e95ebd0dcca5241415344b426fc359ceb5f8b72a590829352f7844b71febb3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f6e7075727669732f73717565616b79)[![Packagist Downloads](https://camo.githubusercontent.com/fc963b565b6bb2b4d82382ec3653146261af7a3ef10c58a79dd19e3ddc703bb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f6e7075727669732f73717565616b79)](https://camo.githubusercontent.com/fc963b565b6bb2b4d82382ec3653146261af7a3ef10c58a79dd19e3ddc703bb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6f6e7075727669732f73717565616b79)

Introduction
------------

[](#introduction)

Squeaky (short for Squeaky Clean) is a Laravel validation rule that you can add your Laravel application, to ensure any user submitted input such as a name or biography, is free of profanity and therefore, clean. Just add `new Clean()` to your rules and you're good to go!

Squeaky is powered by [Pest Profanity Plugin](https://github.com/pestphp/pest-plugin-profanity), which is a PestPHP Plugin that does the same thing, but for code. By utilising the profanity in that package, Squeaky is powerful from the get-go and provides support for numerous locales, not just English.

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

[](#installation)

To install Squeaky, you can run the following command in your project's root:

```
composer require jonpurvis/squeaky

```

After installation, you can publish the configuration file to customize the package behavior:

```
php artisan vendor:publish --provider="JonPurvis\Squeaky\SqueakyServiceProvider"
```

This will create a `config/squeaky.php` file in your application where you can configure custom blocked and allowed words.

Examples
--------

[](#examples)

Let's take a look at how Squeaky works. As it's a Laravel Validation rule, there's not really that much to it. You would use it in the same way you would use a custom validation rule you've added yourself.

Let's take the following scenario where we have a form that allows a user to enter their name, email and bio:

```
use App\Models\User;
use Illuminate\Validation\Rule;
use JonPurvis\Squeaky\Rules\Clean;

return [
    'name' => ['required', 'string', 'max:255', new Clean],
    'email' => [
        'required',
        'string',
        'lowercase',
        'email',
        'max:255',
        Rule::unique(User::class)->ignore($this->user()->id),
    ],
    'bio' => ['required', 'string', 'max:255', new Clean],
];
```

You'll notice that both *name* and *bio* are using the **Clean** rule. This rule will take the value and ensure that it doesn't exist in the profanity config files that the package has. By default, it will use your app locale, so if your locale is set to `en`, it will scan profanity in the *en* profanity config.

If profanity is found, an error will appear in the validation errors array and will be shown to your user (if your application does this).

Some applications allow for more than one language, so you're able to pass in additional locales to the rule to cater for them. Below is an example showing how to cater for both `en` and `it`:

```
use JonPurvis\Squeaky\Rules\Clean;

'name' => ['required', 'string', 'max:255', new Clean(['en', 'it'])],
```

Alternatively, instead of passing an array of strings to the rule, you can pass in an array of `JonPurvis\Squeaky\Enums\Locale` enums to specify the locales:

```
use JonPurvis\Squeaky\Enums\Locale;
use JonPurvis\Squeaky\Rules\Clean;

'name' => ['required', 'string', 'max:255', new Clean([Locale::English, Locale::Italian])],
```

This will then check the locale config for any locale you've passed in (providing the config exists!). If profanity is found in any of them, an error will appear in the validation errors.

The really cool thing about this, is the error will be returned in the language that failed. So if the failure was found in the `it` profanity list, the package assumes the user is Italian and returns the error message in Italian to let them know that their value is not clean.

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

[](#configuration)

Squeaky provides a publishable configuration file that allows you to customize the package behavior for your specific application needs.

### Custom Words

[](#custom-words)

You can specify custom words that should be treated as profanity or explicitly allowed:

```
// config/squeaky.php
return [
    'blocked_words' => [
        'company_secret',
        'internal_term',
        'restricted_word',
    ],

    'allowed_words' => [
        'analytics',
        'scunthorpe',
        'penistone',
    ],

    'case_sensitive' => false,
];
```

- **`blocked_words`**: Words that will be treated as profanity regardless of the locale-specific profanity lists. These override everything else.
- **`allowed_words`**: Words that will be explicitly allowed even if they appear in the locale-specific profanity lists.
- **`case_sensitive`**: Determines whether word matching should be case-sensitive. Defaults to `false` for case-insensitive matching.

### Priority Order

[](#priority-order)

The validation follows this priority order:

1. Custom blocked words (highest priority - always blocked)
2. Custom allowed words (override locale profanity)
3. Locale-specific profanity lists (lowest priority)

Languages
---------

[](#languages)

Squeaky currently supports the following languages:

- Arabic
- Danish
- English
- German
- Spanish
- Italian
- Japanese
- Dutch
- Brazilian Portuguese
- Russian

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

[](#contributing)

Contributions to the package are more than welcome! Depending on the type of change, there's a few extra steps that will need carrying out:

### Existing Locale Changes

[](#existing-locale-changes)

These changes should be done in [Pest Profanity Plugin](https://github.com/pestphp/pest-plugin-profanity) and a new release should be tagged. Dependabot will then open a PR on this repo. Once that's been merged, it should be good to go because the config will already be getting loaded.

### New Locale Support

[](#new-locale-support)

The new locale config will need adding to [Pest Profanity Plugin](https://github.com/pestphp/pest-plugin-profanity)first and a new release should be tagged. Dependabot will then open a PR on this repo. Additionally, the new config will need loading in within the `boot` method of the service provider of this package.

A new case will also need adding to the `JonPurvis/Squeaky/Enums/Locale` enum to support the new locale.

### Functionality Changes

[](#functionality-changes)

For changes to how this rule works, these should be done in this package. No change needed to Pest Profanity Plugin.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance90

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~30 days

Recently: every ~50 days

Total

14

Last Release

50d ago

Major Versions

v1.7.0 → v2.0.02025-09-09

PHP version history (3 changes)v1.0.0PHP ^8.2|^8.3|^8.4

v1.2.0PHP ^8.2

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7534029?v=4)[jp](/maintainers/JonPurvis)[@JonPurvis](https://github.com/JonPurvis)

---

Top Contributors

[![JonPurvis](https://avatars.githubusercontent.com/u/7534029?v=4)](https://github.com/JonPurvis "JonPurvis (75 commits)")[![ash-jc-allen](https://avatars.githubusercontent.com/u/39652331?v=4)](https://github.com/ash-jc-allen "ash-jc-allen (4 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![hd505495](https://avatars.githubusercontent.com/u/36855671?v=4)](https://github.com/hd505495 "hd505495 (1 commits)")[![jeffersongoncalves](https://avatars.githubusercontent.com/u/411493?v=4)](https://github.com/jeffersongoncalves "jeffersongoncalves (1 commits)")[![markovic-nikola](https://avatars.githubusercontent.com/u/16388545?v=4)](https://github.com/markovic-nikola "markovic-nikola (1 commits)")

---

Tags

frameworklaravelpluginprofanityvalidationphppluginframeworklaravelprofanity

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jonpurvis-squeaky/health.svg)

```
[![Health](https://phpackages.com/badges/jonpurvis-squeaky/health.svg)](https://phpackages.com/packages/jonpurvis-squeaky)
```

###  Alternatives

[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[pestphp/pest-plugin-profanity

The Pest Profanity Plugin

1048.8M28](/packages/pestphp-pest-plugin-profanity)[pestphp/pest-plugin-arch

The Arch plugin for Pest PHP.

4145.8M4.0k](/packages/pestphp-pest-plugin-arch)[pestphp/pest-plugin-faker

The Pest Faker Plugin

376.4M206](/packages/pestphp-pest-plugin-faker)[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13753.8k](/packages/spatie-pest-plugin-route-testing)[dragon-code/support

Support package is a collection of helpers and tools for any project.

238.7M101](/packages/dragon-code-support)

PHPackages © 2026

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