2017 © Pedro Peláez
 

library validation

Laravel persian validation

image

anetwork/validation

Laravel persian validation

  • Thursday, January 18, 2018
  • by coffeetalkh
  • Repository
  • 6 Watchers
  • 64 Stars
  • 4,867 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 35 Versions
  • 10 % Grown

The README.md

:red_circle: This package will no longer be develop and supported :red_circle:

.
.
.
.
.
.
.
Build Status Latest Stable Version Total Downloads License, (*1)

Laravel Persian Validation

Laravel Persian Validation provides validation for Persian alphabet, number and etc., (*2)

Requirement

  • Laravel 5.*
  • PHP 5.5 >=

License

Laravel Persian Validation is open-sourced software licensed under the MIT license, (*3)

Install

Via Composer, (*4)

``` bash $ composer require Anetwork/Validation, (*5)


## Config Add the following provider to providers part of config/app.php ``` php Anetwork\Validation\PersianValidationServiceProvider::class

vendor:publish

You can run vendor:publish command to have custom lang file of package on this path ( resources/lang/validation ), (*6)

Usage

You can access to validation rules by passing the rules key according blew following table:, (*7)

Rules Descriptions
persian_alpha Persian alphabet
persian_num Persian numbers
persian_alpha_num Persian alphabet and numbers
iran_mobile Iran mobile numbers
sheba Iran Sheba numbers
melli_code Iran melli code
is_not_persian Doesn't accept Persian alphabet and numbers
limited_array Check variable is array and array must be lesser and equal than parameter
unsigned_num Check variable is unsigned numbers
alpha_space Accept Persian, English and ... alphabet, space character
a_url Check correct URL
a_domain Check correct Domain
more Check value be max and not equal too
less Check value be min and not equal too
iran_phone Iran phone numbers
card_number Payment card numbers
address Accept Persian, English and ... alphabet, Persian and English numbers and some special characters
iran_postal_code Iran postal code
package_name Check APK package name

Persian Alpha

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

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

$rules = [ 'persian_alpha' ];

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

Persian numbers

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

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

$rules = [ 'persian_num' ];

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

Persian Alpha Num

Validate Persian alpha num:, (*10)

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

$rules = [ 'persian_alpha_num' ];

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

Iran mobile phone

Validate Iran mobile phones (irancel, rightel, hamrah-e-aval, ...):, (*11)

$input = [ '09381234567' ];

$rules = [ 'iran_mobile' ];

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

Sheba number

Validate Iran bank sheba numbers:, (*12)

$input = [ 'IR062960000000100324200001' ];

$rules = [ 'sheba' ];

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

Iran national code

Validate Iran national code (melli-code):, (*13)

$input = [ '3240175800' ];

$rules = [ 'melli_code' ];

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

Payment card number

Validate Iran payment card numbers:, (*14)

$input = [ '6274129005473742' ];

$rules = [ 'card_number' ];

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

Iran postal code

Validate Iran postal code:, (*15)

$input = [ '167197-35744' ];

$rules = [ 'iran_postal_code' ];

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


$input = [ '16719735744' ];

$rules = [ 'iran_postal_code' ];

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

More

Here is full list of Anetwork validation rules usage:, (*16)

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

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

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

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

'mobile' => 'iran_mobile', // Validate mobile number, (*21)

'sheba_number' => 'sheba', // Validate sheba number of bank account, (*22)

'melli_code' => 'melli_code', // Validate melli code number, (*23)

'latin_name' => 'is_not_persian', // Validate alphabet and doesn't contain Persian alphabet or number, (*24)

'your_array' => 'limited_array:2', // Validate your array variable and must be contian 2 member or lesser, (*25)

'url' => 'a_url', // Validate url, (*26)

'domain' => 'a_domain', // Validate domain, (*27)

'more' => 'more:10', // Validate value be more than parameter, (*28)

'less' => 'less:10', // Validate value be less than parameter, (*29)

'phone' => 'iran_phone', // Validate phone number, (*30)

'card_number' => 'card_number', // Validate payment card number, (*31)

'address' => 'address' // validate Persian, English and ... alphabet, Persian and English numbers and some special characters, (*32)

'postal_code' => 'iran_postal_code' // validate iran postal code format, (*33)

'package_name' => 'package_name' // validate APK package name, (*34)

]); ```, (*35)

The Versions

18/01 2018

dev-master

9999999-dev

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

29/07 2017

dev-develop

dev-develop

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

10/06 2017

v2.1.0

2.1.0.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

07/06 2017

v2.0.0

2.0.0.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

19/04 2017

v1.0.0

1.0.0.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

18/04 2017

v0.3.9

0.3.9.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

05/04 2017

v0.3.8

0.3.8.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

03/04 2017

v0.3.7

0.3.7.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

The Development Requires

by Shahrokh Niakan

07/02 2017

v0.3.6

0.3.6.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

06/02 2017

v0.3.5

0.3.5.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

26/11 2016

v0.3.4

0.3.4.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

09/10 2016

v0.3.3

0.3.3.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

03/10 2016

v0.3.2

0.3.2.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

28/09 2016

v0.3.1

0.3.1.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

21/09 2016

v0.3.0

0.3.0.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

13/09 2016

v0.2.9

0.2.9.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

24/08 2016

v0.2.8

0.2.8.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

24/08 2016

v0.2.7

0.2.7.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

17/08 2016

v0.2.6

0.2.6.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

12/08 2016

v0.2.5

0.2.5.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

10/08 2016

v0.2.4

0.2.4.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

09/08 2016

v0.2.3

0.2.3.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

03/08 2016

v0.2.2

0.2.2.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

22/07 2016

v0.2.1

0.2.1.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

21/06 2016

v0.2.0

0.2.0.0

Laravel persian validation

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

14/06 2016

v0.1.9

0.1.9.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

14/06 2016

v0.1.8

0.1.8.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

14/06 2016

v0.1.7

0.1.7.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

14/06 2016

v0.1.6

0.1.6.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

11/06 2016

v0.1.5

0.1.5.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

08/06 2016

v0.1.4

0.1.4.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

03/06 2016

v0.1.3

0.1.3.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

28/05 2016

v0.1.2

0.1.2.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

25/05 2016

v0.1.1

0.1.1.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan

24/05 2016

v0.0.1

0.0.1.0

  Sources   Download

MIT

The Requires

 

by Shahrokh Niakan