PHPackages                             byteweld/laravel-validation-rules - 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. byteweld/laravel-validation-rules

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

byteweld/laravel-validation-rules
=================================

Custom validation rules for Laravel.

v1.0.2(1y ago)05MITPHPPHP &gt;=8.0

Since Apr 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/byteweld/laravel-validation-rules)[ Packagist](https://packagist.org/packages/byteweld/laravel-validation-rules)[ RSS](/packages/byteweld-laravel-validation-rules/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Laravel Validation Rules Package
================================

[](#laravel-validation-rules-package)

A package to add custom validation rules for Laravel, including country-based phone number validation.

🚀 Features
----------

[](#-features)

- Country-based phone number validation.
- International phone number validation.
- Easy integration with Laravel validation.
- Supports multiple countries (more coming soon).

---

📦 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require byteweld/laravel-validation-rules
```

After installation, Laravel will automatically discover the service provider.

If you're using Laravel &lt;5.5, you need to add the service provider manually in `config/app.php`:

```
'providers' => [
    Byteweld\ValidationRules\Providers\ValidationServiceProvider::class,
],
```

---

🛠 Usage
-------

[](#-usage)

You can use the validation rules in Laravel’s validation system.

### 📞 Country-Based Phone Number Validation

[](#-country-based-phone-number-validation)

#### Rule: `phone_number:{country}`

[](#rule-phone_numbercountry)

This rule validates a phone number based on country-specific criteria.

#### Example Usage

[](#example-usage)

```
$request->validate([
    'phone' => 'required|phone_number:india',
]);
```

#### Validation Logic for India

[](#validation-logic-for-india)

✅ Must contain **only numbers**
✅ Length must be **exactly 10 digits**
✅ Must start with **6, 7, 8, or 9**

---

### 🌎 International Phone Number Validation

[](#-international-phone-number-validation)

#### Rule: `international_phone_number:{country}`

[](#rule-international_phone_numbercountry)

This rule validates international phone numbers according to country-specific formats.

#### Example Usage

[](#example-usage-1)

```
$request->validate([
    'phone' => 'required|international_phone_number:india',
]);
```

#### Validation Logic for India

[](#validation-logic-for-india-1)

✅ Must contain **only numbers**
✅ Length must be **exactly 13 characters**
✅ Must start with **+91** followed by a **10-digit mobile number**
✅ The number must start with **6, 7, 8, or 9**

---

🧪 Running Tests
---------------

[](#-running-tests)

To ensure everything works as expected, run the tests:

```
php artisan test
```

---

🛠 Customization
---------------

[](#-customization)

You can extend the validation for more countries. To contribute, submit a **pull request** on [GitHub](https://github.com/byteweld/laravel-validation-rules).

---

📌 Versioning
------------

[](#-versioning)

This package follows **semantic versioning** (`MAJOR.MINOR.PATCH`).

- `v1.0.0` - Initial release with basic validation.
- `v1.1.0` - Added support for international phone validation.
- Future versions will include more country rules.

---

📜 License
---------

[](#-license)

This package is open-source and licensed under the **MIT License**.

---

🔗 Contributing
--------------

[](#-contributing)

We welcome contributions! If you find a bug or want to add more validation rules, feel free to:

1. Fork the repo.
2. Create a new branch.
3. Submit a pull request.

---

📬 Support
---------

[](#-support)

For any issues, open an issue on GitHub:
🔗 **[GitHub Issues](https://github.com/byteweld/laravel-validation-rules/issues)**

---

### 📢 Next Steps

[](#-next-steps)

✅ Add support for more countries
✅ Add a configuration file for dynamic country validation
✅ Improve test coverage

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance46

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

3

Last Release

404d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dbdf98d189d2dacde3641b8cde57e6e5a40db6d69e7e3ebf13f395afc9d9dba8?d=identicon)[byteweld](/maintainers/byteweld)

---

Top Contributors

[![byteweld](https://avatars.githubusercontent.com/u/205899082?v=4)](https://github.com/byteweld "byteweld (4 commits)")[![gowthamardhas](https://avatars.githubusercontent.com/u/143775370?v=4)](https://github.com/gowthamardhas "gowthamardhas (1 commits)")

### Embed Badge

![Health badge](/badges/byteweld-laravel-validation-rules/health.svg)

```
[![Health](https://phpackages.com/badges/byteweld-laravel-validation-rules/health.svg)](https://phpackages.com/packages/byteweld-laravel-validation-rules)
```

###  Alternatives

[spatie/laravel-honeypot

Preventing spam submitted through forms

1.6k6.0M60](/packages/spatie-laravel-honeypot)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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