PHPackages                             nawrasbukhari/restricted - 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. [Security](/categories/security)
4. /
5. nawrasbukhari/restricted

ActiveLibrary[Security](/categories/security)

nawrasbukhari/restricted
========================

Restricts registration when a user's input (eg: username) matches a list of restricted words

1.0.1(3y ago)014MITPHPPHP ^8.0.2

Since Jan 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/NawrasBukhari/laravel-reserved)[ Packagist](https://packagist.org/packages/nawrasbukhari/restricted)[ RSS](/packages/nawrasbukhari-restricted/feed)WikiDiscussions main Synced 1mo ago

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

Restricted
==========

[](#restricted)

Restricted allows you to restrict your users from signing up with reserved words.

Reserved words can be:

1. Your route segments - Example, you have this route: [www.mywebsite.com/login](http://www.mywebsite.com/login)and your application allows to view user profile like this: [www.mywebsite.com/username](http://www.mywebsite.com/username)This package can crawl all your routes and return a validation message when a user tries to register with such words like "login"
2. Words you just want to reserve - Example: cart, products, admin etc. These words can be added manually to the reserved.txt file. after running the "restricted:index" command.

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

[](#installation)

To install Restricted use composer

### Download

[](#download)

```
composer require nawrasbukhari/restricted

```

### Publish the config

[](#publish-the-config)

```
php artisan vendor:publish --provider="Nawras\Restricted\RestrictedServiceProvider" --tag="config"

```

Usage
-----

[](#usage)

First, we need to crawl and index the application routes by running the command:

```
php artisan restricted:index

```

Now, you can simply add restricted to your validations like so:

```
    $this->validate($request, [
        'name' => 'required|string|min:5',
        'username' => 'required|restricted'
    ]);
```

You can also add a new validation message

```
    $this->validate($request, [
        'name' => 'required|string|min:5',
        'username' => 'required|restricted'
    ],[
    	'username.restricted' => 'A user exists with that username. Please try another or add more characters'
    ]);
```

Settings
--------

[](#settings)

- file\_path: (string) File name and path to save the indexed words
- index\_level: (int) How deep do u want us to crawl your routes? ExAMPLE =&gt; [www.mywebsite.com/segment1/segment2/segment3](http://www.mywebsite.com/segment1/segment2/segment3). setting this value to '2', will allow indexing of segment1 and segment2 and exclude segment3
- merge: (bool) should we to merge the new results with the old ones

License
-------

[](#license)

MIT license - free to use and abuse!

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

1231d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/29cbb8c2f17378feaa5074e50a33b24d2ea2b41bf4f05d5bcf7af9e9e0561d54?d=identicon)[nbukhari](/maintainers/nbukhari)

---

Top Contributors

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

---

Tags

securityusernamerestricted

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nawrasbukhari-restricted/health.svg)

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

###  Alternatives

[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

71510.9M66](/packages/laravel-mcp)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[jorijn/laravel-security-checker

Added Laravel functionality to the Enlightn Security Checker. Adds a command to check for, and optionally emails you, vulnerabilities when they affect you.

2021.8M1](/packages/jorijn-laravel-security-checker)[tzsk/otp

A secure, database-free One-Time Password (OTP) generator and verifier for PHP and Laravel.

241641.4k1](/packages/tzsk-otp)[ercsctt/laravel-file-encryption

Secure file encryption and decryption for Laravel applications

642.6k](/packages/ercsctt-laravel-file-encryption)

PHPackages © 2026

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