PHPackages                             coolrist/role-based-email-validator - 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. coolrist/role-based-email-validator

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

coolrist/role-based-email-validator
===================================

Laravel custom rule to detect role-based emails.

v1.0.0(9mo ago)32[1 issues](https://github.com/coolrist/laravel-role-based-email-validator/issues)MITPHPPHP ^8.0

Since Jul 29Pushed 9mo agoCompare

[ Source](https://github.com/coolrist/laravel-role-based-email-validator)[ Packagist](https://packagist.org/packages/coolrist/role-based-email-validator)[ RSS](/packages/coolrist-role-based-email-validator/feed)WikiDiscussions main Synced 1mo ago

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

Documentation: `Coolrist/RoleBasedEmailValidator` Package
=========================================================

[](#documentation-coolristrolebasedemailvalidator-package)

The `Coolrist/RoleBasedEmailValidator` package is a **Laravel extension** that adds a **custom validation rule** to block role-based email addresses like `admin@`, `info@`, `support@`, etc. It ensures users register with **personal email addresses**, improving the reliability of your user data and the effectiveness of your communication.

---

1. Why Use This Package?
------------------------

[](#1-why-use-this-package)

In many applications, it's important to make sure each user is uniquely identifiable. This package helps you:

- ✅ **Improve user data quality** – no more generic emails in your database.
- 🚫 **Reduce spam and abuse** – role-based addresses are commonly used for testing or fraudulent signups.
- 📬 **Enable targeted communication** – you’re messaging a real person, not a shared inbox.

---

2. Installation
---------------

[](#2-installation)

Install it via Composer:

```
composer require coolrist/role-based-email-validator
```

Then, **publish the configuration file** (optional but recommended):

```
php artisan vendor:publish --tag=coolrist-role-based-config
```

This creates a `config/role_based.php` file where you can tweak settings to fit your use case.

---

3. Configuration
----------------

[](#3-configuration)

Here’s what the config file looks like:

```
return [
    'only_custom' => false, // Leave false to use the built-in list + your custom list
    'list' => [
        // Add your own role-based email prefixes here
        'compta',
        'direction',
        // Common ones like 'admin', 'support' are already covered internally
    ],
];
```

- `only_custom => false`: combines the **internal list** (included in the package) with your custom list. Best for full protection.
- `only_custom => true`: disables the internal list and uses **only** your custom entries.

The internal list already includes common role-based prefixes like `admin`, `support`, `info`, `sales`, and more.

---

4. Usage
--------

[](#4-usage)

Once installed and configured, you can use the `not_role_based` rule in your Laravel validators:

```
Validator::make($request->all(), [
    'email' => 'required|email|not_role_based|unique:users,email', //  'required|email:strict,dns,spoof|indisposable|not_role_based',
```

💥 With this combo, you ensure the email is technically valid, not disposable, **and** not role-based. Only solid, permanent, personal emails get through.

---

6. Want to Help Us Push This Like a TUF Laptop with an RTX? 🚀🎮
--------------------------------------------------------------

[](#6-want-to-help-us-push-this-like-a-tuf-laptop-with-an-rtx-)

If you want to support the project — with some code, some cash, or just good vibes — reach out! The maintainer's email is in the `composer.json` file, like a hidden bonus in a well-coded level. 💌

We love stylish commits, fresh ideas, and even dream-desk setup gifs (especially with RGB lighting). Thanks for being here — whether you're a dev, supporter, or just a curious visitor stopping by with good energy. 💻🔥

---

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance49

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

293d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7e4c79fea98ac0156c2a90f1f15833a5b41bd3d6e7f3d192879d76334d262531?d=identicon)[coolrist](/maintainers/coolrist)

---

Top Contributors

[![coolrist](https://avatars.githubusercontent.com/u/143043407?v=4)](https://github.com/coolrist "coolrist (7 commits)")

---

Tags

phplaravelvalidationsecuritylaravel-packageregexrulesform validationemail validationuser-rolescustom rulerole-based email

### Embed Badge

![Health badge](/badges/coolrist-role-based-email-validator/health.svg)

```
[![Health](https://phpackages.com/badges/coolrist-role-based-email-validator/health.svg)](https://phpackages.com/packages/coolrist-role-based-email-validator)
```

###  Alternatives

[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)[progsmile/request-validator

Simple PHP Request Validator

33113.3k1](/packages/progsmile-request-validator)

PHPackages © 2026

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