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 today

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 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

1278d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/40843430?v=4)[nbukhari](/maintainers/nbukhari)[@nbukhari](https://github.com/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.

77022.3M149](/packages/laravel-mcp)[livewire/livewire

A front-end framework for Laravel.

23.6k89.0M2.7k](/packages/livewire-livewire)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M130](/packages/roots-acorn)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.5k21.5M581](/packages/laravel-boost)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)

PHPackages © 2026

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