PHPackages                             zareshahi/laravel-persian-validation - 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. zareshahi/laravel-persian-validation

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

zareshahi/laravel-persian-validation
====================================

A persian alphabet, number and etc. validation package for laravel

1.2.4(4y ago)04MITPHPPHP &gt;=7.2|8.\*

Since Sep 18Pushed 4y agoCompare

[ Source](https://github.com/ali-zareshai/laravel-persian-validation)[ Packagist](https://packagist.org/packages/zareshahi/laravel-persian-validation)[ RSS](/packages/zareshahi-laravel-persian-validation/feed)WikiDiscussions master Synced today

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

Laravel Persian Validation
==========================

[](#laravel-persian-validation)

Laravel Persian Validation Provides validation for Persian alphabet, number and etc.

Requirement
-----------

[](#requirement)

- Laravel 6, 7, 8
- PHP 7.2 &gt;=

Install
-------

[](#install)

Via Composer

```
composer require sadegh19b/laravel-persian-validation
```

vendor:publish
--------------

[](#vendorpublish)

You can run vendor:publish command to have custom lang file of package on this path ( resources/lang/{locale}/persian-validation.php )

```
php artisan vendor:publish --provider="Sadegh19b\LaravelPersianValidation\PersianValidationServiceProvider"
```

Usage
-----

[](#usage)

You can access to validation rules by passing the rules key according blew following table:

RulesDescriptionsAcceptable Examplespersian\_alphaPersian alphabetصادقpersian\_numPersian numbers۱۲۳۴persian\_alpha\_numPersian alphabet and numbersصادق۱۲۳۴persian\_alpha\_eng\_numPersian alphabet and numbers with english numbersصادق۱۲34persian\_not\_acceptDoesn't accept Persian alphabet and numberscant be persianshamsi\_dateCheck shamsi (jalali) date with format(Y/m/d)1373/3/19shamsi\_date:persianCheck shamsi (jalali) date with format(Y/m/d) with persian number۱۳۷۳/۳/۱۹shamsi\_date\_between:1300,1400Check shamsi (jalali) date with format(Y/m/d) between years1373/3/19shamsi\_date\_between:1300,1400,persianCheck shamsi (jalali) date with format(Y/m/d) between years with persian number۱۳۷۳/۳/۱۹ir\_mobileIranian mobile numbers00989173456789, +989173456789, 989173456789, 09173456789, 91712345678ir\_mobile:zero\_codeIranian mobile numbers with double zero country code00989173456789ir\_mobile:plusIranian mobile numbers with plus country code+989173456789ir\_mobile:codeIranian mobile numbers with country code989173456789ir\_mobile:zeroIranian mobile numbers starts with zero09173456789ir\_mobile:without\_zeroIranian mobile numbers without first zero9173456789ir\_phoneIranian phone numbers37236445ir\_phone\_codeIranian phone area code077, 021, ...ir\_phone\_with\_codeIranian phone number with area code07737236445ir\_postal\_codeIranian postal code1619735744, 16197-35744ir\_postal\_code:seprateIranian postal code sperated16197-35744ir\_postal\_code:without\_seprateIranian postal code without seprate1619735744ir\_bank\_card\_numberIranian bank payment card numbers6274129005473742ir\_bank\_card\_number:seprateIranian bank payment card numbers seprate between digits with dash6274-1290-0547-3742ir\_bank\_card\_number:spaceIranian bank payment card numbers seprate between digits with space6274 1290 0547 3742ir\_shebaIranian Sheba numbersIR062960000000100324200001ir\_national\_codeIran melli code0013542419a\_urlCheck correct URL, a\_domainCheck correct Domain[www.google.com](http://www.google.com), google.com### Persian Alpha

[](#persian-alpha)

Accept Persian language alphabet according to standard Persian, this is the way you can use this validation rule:

```
$input = [ 'فارسی' ];

$rules = [ 'persian_alpha' ];

Validator::make( $input, $rules );
```

### Persian numbers

[](#persian-numbers)

Validate Persian standard numbers (۰۱۲۳۴۵۶۷۸۹):

```
$input = [ '۰۱۲۳۴۵۶۷۸۹' ];

$rules = [ 'persian_num' ];

Validator::make( $input, $rules );
```

### Persian Alpha Num

[](#persian-alpha-num)

Validate Persian alpha num:

```
$input = [ '۰فارسی۱۲۳۴۵۶۷۸۹' ];

$rules = [ 'persian_alpha_num' ];

Validator::make( $input, $rules );
```

### Persian Alpha Eng Num

[](#persian-alpha-eng-num)

Validate Persian alpha num with english num:

```
$input = [ '۰فارسی۱۲۳۴۵6789' ];

$rules = [ 'persian_alpha_eng_num' ];

Validator::make( $input, $rules );
```

### Shamsi Date

[](#shamsi-date)

Validate shamsi (jalali) date:

```
$input = [ '1373/3/19' ];

$rules = [ 'shamsi_date' ];

Validator::make( $input, $rules );
```

### Shamsi Date Between

[](#shamsi-date-between)

Validate shamsi (jalali) date between years:

```
$input = [ '1373/3/19' ];

$rules = [ 'shamsi_date_between:1300,1400' ];

Validator::make( $input, $rules );
```

### Iran mobile phone

[](#iran-mobile-phone)

Validate Iranian mobile numbers (Irancell, Rightel, Hamrah-e-aval, ...):

```
$input = [ '09381234567' ];

$rules = [ 'ir_mobile' ];

Validator::make( $input, $rules );
```

### Sheba number

[](#sheba-number)

Validate Iranian bank sheba numbers:

```
$input = [ 'IR062960000000100324200001' ];

$rules = [ 'ir_sheba' ];

Validator::make( $input, $rules );
```

### Iran national code

[](#iran-national-code)

Validate Iranian national code (Melli Code):

```
$input = [ '3240175800' ];

$rules = [ 'ir_national_code' ];

Validator::make( $input, $rules );
```

### Payment card number

[](#payment-card-number)

Validate Iranian bank payment card numbers:

```
$input = [ '6274129005473742' ];

$rules = [ 'ir_bank_card_number' ];

Validator::make( $input, $rules );
```

### Iran postal code

[](#iran-postal-code)

Validate Iranian postal code:

```
$input = [ '167197-35744' ];

$rules = [ 'ir_postal_code' ];

Validator::make( $input, $rules );

or

$input = [ '16719735744' ];

$rules = [ 'ir_postal_code' ];

Validator::make( $input, $rules );
```

More
----

[](#more)

Full list of Persian Validation rules usage:

```
Validator::make( $request->all(), [

  'name'          => 'persian_alpha|unique|max:25', // Validate Persian alphabet, unique and max to 25 characters

  'age'           => 'persian_num|required',  // Validate Persian numbers and check it's required

  'city'          => 'persian_alpha_num|min:10',  // Validate persian alphabet & numbers at least 10 digit accepted

  'address'       => 'persian_alpha_eng_num',  // Validate persian alphabet & numbers with english numbers

  'birthday'      => 'shamsi_date', // Validate shamsi date

  'start_date'    => 'shamsi_date_between:1300,1400', // Validate shamsi date between years

  'mobile'        => 'ir_mobile', // Validate mobile number

  'sheba_number'  => 'ir_sheba', // Validate sheba number of bank account

  'melli_code'    => 'ir_national_code',  // Validate melli code number

  'latin_name'    => 'persian_not_accept',  // Validate alphabet and doesn't contain Persian alphabet or number

  'url'           => 'a_url', // Validate url

  'domain'        => 'a_domain',  // Validate domain

  'phone'         => 'ir_phone', // Validate phone number

  'area_code'     => 'ir_phone_code', // Validate phone area code

  'phone_code'    => 'ir_phone_with_code', // Validate phone number with area code

  'card_number'   => 'ir_bank_card_number', // Validate payment card number

  'postal_code'   => 'ir_postal_code' // validate iran postal code format

]);
```

License
-------

[](#license)

The [MIT license](http://opensource.org/licenses/MIT) (MIT). Please see [License File](https://github.com/sadegh19b/laravel-persian-validation/blob/master/LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.5% 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 ~111 days

Total

9

Last Release

1590d ago

PHP version history (2 changes)1.0PHP &gt;=7.2

1.2.4PHP &gt;=7.2|8.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/33b1c3fa90ec64c69f9b3eb28b78701994e4c63e0dfb70afc438f89d8183a659?d=identicon)[ali\_zareshahi](/maintainers/ali_zareshahi)

---

Top Contributors

[![sadegh19b](https://avatars.githubusercontent.com/u/54643531?v=4)](https://github.com/sadegh19b "sadegh19b (13 commits)")[![ahbanavi](https://avatars.githubusercontent.com/u/39927312?v=4)](https://github.com/ahbanavi "ahbanavi (2 commits)")[![ali-zareshai](https://avatars.githubusercontent.com/u/22685427?v=4)](https://github.com/ali-zareshai "ali-zareshai (1 commits)")[![hossein-zare](https://avatars.githubusercontent.com/u/56504893?v=4)](https://github.com/hossein-zare "hossein-zare (1 commits)")

---

Tags

laravelvalidatorvalidationvalidatepersianfarsi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zareshahi-laravel-persian-validation/health.svg)

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

###  Alternatives

[sadegh19b/laravel-persian-validation

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

18598.1k1](/packages/sadegh19b-laravel-persian-validation)[proengsoft/laravel-jsvalidation

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

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2462.4M7](/packages/laravel-validation-rules-credit-card)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel

3893.6M1](/packages/axlon-laravel-postal-code-validation)[iamfarhad/validation

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

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

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

183530.2k](/packages/illuminatech-validation-composite)

PHPackages © 2026

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