PHPackages                             wyattcast44/laravel-safe-username - 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. wyattcast44/laravel-safe-username

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

wyattcast44/laravel-safe-username
=================================

Laravel vulgar username filter / validation rule.

5.0.0(1y ago)231.2k2MITPHPPHP ^8.2

Since Aug 10Pushed 1y ago3 watchersCompare

[ Source](https://github.com/WyattCast44/laravel-safe-username)[ Packagist](https://packagist.org/packages/wyattcast44/laravel-safe-username)[ Docs](https://github.com/wyattcast44/laravel-safe-username)[ RSS](/packages/wyattcast44-laravel-safe-username/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (8)Dependencies (11)Versions (9)Used By (0)

Laravel Safe Username
=====================

[](#laravel-safe-username)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d243933867f7ebb429192b70953049e370b377ecec4e9adfed56a08d6f20638e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77796174746361737434342f6c61726176656c2d736166652d757365726e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wyattcast44/laravel-safe-username)[![Total Downloads](https://camo.githubusercontent.com/2e5190e4077a739da13908518bb8330817e4bb8be9a003c471fa4b7d1f95d203/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77796174746361737434342f6c61726176656c2d736166652d757365726e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wyattcast44/laravel-safe-username)

This is a small package to help you easily validate usernames against a list of commonly banned usernames, for example: `json`, `admin`, `security`, etc. You can also add your own custom allowed and disallowed usernames.

You can see the full list of disallowed usernames in the config file, or the [source repo](https://github.com/dsignr/disallowed-usernames) from which the list came from.

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

[](#installation)

You can install the package via composer:

```
composer require wyattcast44/laravel-safe-username
```

Usage
-----

[](#usage)

```
use Wyattcast44\SafeUsername\Rules\AllowedUsername;

Validator::make($request, [
    'username' => ['required', 'string', new AllowedUsername],
]);
```

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

[](#configuration)

You can publish the configuration file with the command below. This will publish a config file called `safe-username.php`.

```
php artisan vendor:publish --provider="Wyattcast44\SafeUsername\SafeUsernameServiceProvider"
```

Once you have published the config file you can add additional usernames to disallow, or add usernames that should pass the validation.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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)

- [Wyatt Castaneda](https://github.com/wyattcast44)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity77

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

Recently: every ~353 days

Total

8

Last Release

642d ago

Major Versions

0.1.0 → 1.0.02020-04-15

1.0.1 → 2.0.02020-11-16

2.1.0 → 3.0.02021-07-29

3.0.0 → 4.0.02022-06-24

4.0.0 → 5.0.02024-09-30

PHP version history (4 changes)0.1.0PHP ^7.1

2.0.0PHP ^7.3

3.0.0PHP ^7.3|^8.0

5.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ec1f5d67a8ace8451f50303ed7fc9185a8298b9a38dc4d47c3aeb283255e66d?d=identicon)[wyattcast44](/maintainers/wyattcast44)

---

Top Contributors

[![WyattCast44](https://avatars.githubusercontent.com/u/17957937?v=4)](https://github.com/WyattCast44 "WyattCast44 (15 commits)")

---

Tags

laravelwyattcast44safe-usernamevulgar wordsusername validationusername filter

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/wyattcast44-laravel-safe-username/health.svg)

```
[![Health](https://phpackages.com/badges/wyattcast44-laravel-safe-username/health.svg)](https://phpackages.com/packages/wyattcast44-laravel-safe-username)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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