PHPackages                             tartan/laravel-custom-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. tartan/laravel-custom-validator

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

tartan/laravel-custom-validator
===============================

Laravel 5+ custom validators

5.0.0(7y ago)2178MITPHPPHP &gt;=5.4.0

Since May 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/iamtartan/laravel-custom-validator)[ Packagist](https://packagist.org/packages/tartan/laravel-custom-validator)[ Docs](https://github.com/theTartancoder/laravel-custom-validator)[ RSS](/packages/tartan-laravel-custom-validator/feed)WikiDiscussions master Synced today

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

Laravel 5+ Custom Validators
============================

[](#laravel-5-custom-validators)

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

[](#installation)

```
composer require "tartan/laravel-custom-validator"

```

Tartan Custom Validators
------------------------

[](#tartan-custom-validators)

Add the required validator(s) to boot method of `app/Providers/AppServiceProvider.php`

```
Validator::extend('strength', 'Tartan\Validators\CustomValidator@validateStrength');
Validator::extend('iran_billing_id', 'Tartan\Validators\CustomValidator@validateIranBillingId');
Validator::extend('iran_shetab_card', 'Tartan\Validators\CustomValidator@validateShetabCard');
Validator::extend('uuid', 'Tartan\Validators\CustomValidator@validateUuid');
Validator::extend('iran_national_id', 'Tartan\Validators\CustomValidator@validateNationalId');
```

Add following lines to `resources/lang/en/validation.php` in `Custom Validation Language Lines` part

```
'strength' => 'The password :attribute is too weak and must contain one or more uppercase, lowercase, numeric, and special character (!@#$%^&*).',
'iran_billing_id' => 'The billing Id `:attribute` is not a valid Billing Id.',
'shetab_card' => 'The card number `:attribute` is not a valid Shetab card number.',
'uuid' => 'The UUID `:attribute` is not a valid UUID.',
'iran_national_id' => 'The national id `:attribute` is not a valid Iran nationa Id.',
```

Use like other validator

```
	...
	'national_id'    => 'required|iran_national_id|unique:users,national_id',
	'password'       => 'required|string|strength|min:6'
	...
```

Team
----

[](#team)

This component is developed by the following person(s) and a bunch of [awesome contributors](https://github.com/theTartancoder/laravel-custom-validator/graphs/contributors).

[![Aboozar Ghaffari](https://avatars1.githubusercontent.com/u/502961?s=200&v=4)](https://github.com/iamtartan)[Aboozar Ghaffari](https://github.com/theTartancoder)Support This Project
--------------------

[](#support-this-project)

[![Donate via Paypal](https://camo.githubusercontent.com/7b6de155df30b37b25eb5fec52f9213680c3dbf067dfb7d7e2850ac4096c7d05/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e6174655f534d2e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LXEL22GFTXTKN)

License
-------

[](#license)

The Laravel Custom Validator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

2915d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9299d1f63e54a717d0b785253adc636f90c3b460ae9bd24bfc1505ef5f90f1ec?d=identicon)[tartan](/maintainers/tartan)

---

Top Contributors

[![samuraee](https://avatars.githubusercontent.com/u/502961?v=4)](https://github.com/samuraee "samuraee (1 commits)")

---

Tags

laravelvalidatorpackagecomponentpersianiranian

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tartan-laravel-custom-validator/health.svg)

```
[![Health](https://phpackages.com/badges/tartan-laravel-custom-validator/health.svg)](https://phpackages.com/packages/tartan-laravel-custom-validator)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[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)[sadegh19b/laravel-persian-validation

A comprehensive Laravel validation package for Persian text, numbers, dates, and Iranian national identifiers

18293.8k1](/packages/sadegh19b-laravel-persian-validation)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)[iamfarhad/validation

🇮🇷 Complete Laravel Persian validation package - Iranian national ID, mobile numbers, Shamsi dates, IBAN/Sheba, postal codes &amp; more. Modern Laravel 10-12 support with both ValidationRule objects &amp; string-based rules.

2917.3k](/packages/iamfarhad-validation)

PHPackages © 2026

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