All Projects → anetwork → Validation

anetwork / Validation

Licence: mit
🔒 Laravel farsi/persian validation

Projects that are alternatives of or similar to Validation

Validation Composite
Allows uniting of several validation rules into single one for easy re-usage
Stars: ✭ 159 (+11.97%)
Mutual labels:  validation, validator, laravel
Laravel Zip Validator
Laravel ZIP file content validator
Stars: ✭ 120 (-15.49%)
Mutual labels:  validation, validator, laravel
Credit Card
Credit Card Validation
Stars: ✭ 150 (+5.63%)
Mutual labels:  validation, validator, laravel
Validation
The power of Respect Validation on Laravel
Stars: ✭ 188 (+32.39%)
Mutual labels:  validation, validator, laravel
Inspector
A tiny class validation library.
Stars: ✭ 64 (-54.93%)
Mutual labels:  validation, validator
Is
Micro check library in Golang.
Stars: ✭ 61 (-57.04%)
Mutual labels:  validation, validator
Schemasafe
A reasonably safe JSON Schema validator with draft-04/06/07/2019-09 support.
Stars: ✭ 67 (-52.82%)
Mutual labels:  validation, validator
Laravel Multistep Forms
Responsable Multistep Form Builder for Laravel
Stars: ✭ 76 (-46.48%)
Mutual labels:  validation, laravel
Govalidator
Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.
Stars: ✭ 969 (+582.39%)
Mutual labels:  validation, validator
Unicorn
Unicorn - W3C's Unified Validator
Stars: ✭ 70 (-50.7%)
Mutual labels:  validation, validator
Ngx Dynamic Form Builder
FormBuilder + class-transformer + class-validator = dynamic form group builder for Angular10+
Stars: ✭ 93 (-34.51%)
Mutual labels:  validation, validator
Laravel Smart
Automatic Migrations, Validation and More
Stars: ✭ 48 (-66.2%)
Mutual labels:  validation, laravel
Laravel5 Genderize Api Client
Laravel 5 client for the Genderize.io API
Stars: ✭ 47 (-66.9%)
Mutual labels:  validation, laravel
Vee Validate
✅ Form Validation for Vue.js
Stars: ✭ 8,820 (+6111.27%)
Mutual labels:  validation, validator
Validator
Client-side javascript validator library ports from Laravel 5.2
Stars: ✭ 35 (-75.35%)
Mutual labels:  validation, laravel
Form Object
Form object to use with Vue components for sending data to a Laravel application using axios.
Stars: ✭ 73 (-48.59%)
Mutual labels:  validation, laravel
Validator
A tool to validate text inside TextInputLayout
Stars: ✭ 117 (-17.61%)
Mutual labels:  validation, validator
Awesome Python Models
A curated list of awesome Python libraries, which implement models, schemas, serializers/deserializers, ODM's/ORM's, Active Records or similar patterns.
Stars: ✭ 124 (-12.68%)
Mutual labels:  validation, validator
Apvalidators
Codeless solution for form validation in iOS!
Stars: ✭ 130 (-8.45%)
Mutual labels:  validation, validator
Ismailfine
A simple (but correct) library for validating email addresses. Supports mail addresses as defined in rfc5322 as well as the new Internationalized Mail Address standards (rfc653x). Based on https://github.com/jstedfast/EmailValidation
Stars: ✭ 9 (-93.66%)
Mutual labels:  validation, validator

Build Status Scrutinizer Code Quality Latest Stable Version Total Downloads License

Laravel Persian Validation

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

Requirement

  • Laravel 5.*
  • PHP 5.5 >=

License

Laravel Persian Validation is open-sourced software licensed under the MIT license

Install

Via Composer

$ composer require Anetwork/Validation

Config

Add the following provider to providers part of config/app.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 )

Usage

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

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:

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

$rules = [ 'persian_alpha' ];

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

Persian numbers

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

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

$rules = [ 'persian_num' ];

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

Persian Alpha Num

Validate Persian alpha num:

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

$rules = [ 'persian_alpha_num' ];

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

Iran mobile phone

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

$input = [ '09381234567' ];

$rules = [ 'iran_mobile' ];

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

Sheba number

Validate Iran bank sheba numbers:

$input = [ 'IR062960000000100324200001' ];

$rules = [ 'sheba' ];

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

Iran national code

Validate Iran national code (melli-code):

$input = [ '3240175800' ];

$rules = [ 'melli_code' ];

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

Payment card number

Validate Iran payment card numbers:

$input = [ '6274129005473742' ];

$rules = [ 'card_number' ];

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

Iran postal code

Validate Iran postal code:

$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:

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

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

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

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

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

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

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

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

  'more'          => 'more:10', // Validate value be more than parameter

  'less'          => 'less:10', // Validate value be less than parameter

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

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

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

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

  'package_name'  => 'package_name' // validate APK package name


]);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].