{"id":37015844,"url":"https://github.com/opencafe/validation","last_synced_at":"2026-01-14T01:36:39.342Z","repository":{"id":36116840,"uuid":"186471743","full_name":"opencafe/validation","owner":"opencafe","description":"🔒 Laravel farsi/persian validation","archived":false,"fork":false,"pushed_at":"2022-05-12T16:36:37.000Z","size":243,"stargazers_count":18,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-31T08:43:43.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opencafe.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-13T18:08:42.000Z","updated_at":"2022-11-16T11:26:40.000Z","dependencies_parsed_at":"2022-09-03T11:02:11.147Z","dependency_job_id":null,"html_url":"https://github.com/opencafe/validation","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/opencafe/validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencafe%2Fvalidation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencafe%2Fvalidation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencafe%2Fvalidation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencafe%2Fvalidation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencafe","download_url":"https://codeload.github.com/opencafe/validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencafe%2Fvalidation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T01:36:38.060Z","updated_at":"2026-01-14T01:36:39.300Z","avatar_url":"https://github.com/opencafe.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/opencafe/validation.svg?branch=master)](https://travis-ci.org/opencafe/validation)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/opencafe/validation/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/anetwork/validation/?branch=master)\n[![Latest Stable Version](https://poser.pugx.org/anetwork/validation/v/stable)](https://packagist.org/packages/anetwork/validation)\n[![Total Downloads](https://poser.pugx.org/anetwork/validation/downloads)](https://packagist.org/packages/anetwork/validation)\n[![License](https://poser.pugx.org/anetwork/validation/license)](https://github.com/anetwork/validation/blob/master/LICENSE.md)\n\n# Laravel Persian Validation\n\nLaravel Persian Validation provides validation for Persian alphabet, number and etc.\n\n## Requirement\n\n* Laravel 5.*\n* PHP 5.6-7.3 \n\n## License\n\nLaravel Persian Validation is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require Anetwork/Validation\n```\n\n## Config\n\nAdd the following provider to providers part of config/app.php\n``` php\nAnetwork\\Validation\\PersianValidationServiceProvider::class\n```\n\n## vendor:publish\nYou can run vendor:publish command to have custom lang file of package on this path ( resources/lang/validation )\n\n## Usage\n\nYou can access to validation rules by passing the rules key according blew following table:\n\n| Rules | Descriptions |\n| --- | --- |\n| persian_alpha | Persian alphabet |\n| persian_num | Persian numbers |\n| persian_alpha_num | Persian alphabet and numbers |\n| iran_mobile | Iran mobile numbers |\n| sheba | Iran Sheba numbers |\n| melli_code | Iran melli code |\n| is_not_persian | Doesn't accept Persian alphabet and numbers |\n| limited_array | Check variable is array and array must be lesser and equal than parameter |\n| unsigned_num | Check variable is unsigned numbers |\n| alpha_space | Accept Persian, English and ... alphabet, space character|\n| a_url | Check correct URL |\n| a_domain | Check correct Domain |\n| more | Check value be max and not equal too|\n| less | Check value be min and not equal too |\n| iran_phone | Iran phone numbers |\n| card_number | Payment card numbers |\n| address | Accept Persian, English and ... alphabet, Persian and English numbers and some special characters|\n| iran_postal_code | Iran postal code |\n| package_name | Check APK package name |\n\n\n### Persian Alpha\nAccept Persian language alphabet according to standard Persian, this is the way you can use this validation rule:\n\n```\n$input = [ 'فارسی' ];\n\n$rules = [ 'persian_alpha' ];\n\nValidator::make( $input, $rules );\n```\n\n### Persian numbers\nValidate Persian standard numbers (۰۱۲۳۴۵۶۷۸۹):\n\n```\n$input = [ '۰۱۲۳۴۵۶۷۸۹' ];\n\n$rules = [ 'persian_num' ];\n\nValidator::make( $input, $rules );\n```\n\n### Persian Alpha Num\nValidate Persian alpha num:\n\n```\n$input = [ 'فارسی۱۲۳۴۵۶۷۸۹' ];\n\n$rules = [ 'persian_alpha_num' ];\n\nValidator::make( $input, $rules );\n```\n\n### Iran mobile phone\nValidate Iran mobile phones (irancel, rightel, hamrah-e-aval, ...):\n\n```\n$input = [ '09381234567' ];\n\n$rules = [ 'iran_mobile' ];\n\nValidator::make( $input, $rules );\n```\n\n### Sheba number\nValidate Iran bank sheba numbers:\n\n```\n$input = [ 'IR062960000000100324200001' ];\n\n$rules = [ 'sheba' ];\n\nValidator::make( $input, $rules );\n```\n\n### Iran national code\nValidate Iran national code (melli-code):\n\n```\n$input = [ '3240175800' ];\n\n$rules = [ 'melli_code' ];\n\nValidator::make( $input, $rules );\n```\n\n### Payment card number\nValidate Iran payment card numbers:\n\n```\n$input = [ '6274129005473742' ];\n\n$rules = [ 'card_number' ];\n\nValidator::make( $input, $rules );\n```\n\n### Iran postal code\nValidate Iran postal code:\n\n```\n$input = [ '167197-35744' ];\n\n$rules = [ 'iran_postal_code' ];\n\nValidator::make( $input, $rules );\n\n\n$input = [ '16719735744' ];\n\n$rules = [ 'iran_postal_code' ];\n\nValidator::make( $input, $rules );\n\n```\n\n## More\nHere is full list of Anetwork validation rules usage:\n\n``` php\nValidator::make( $request-\u003eall(), [\n\n  'name'          =\u003e 'persian_alpha|unique|max:25', // Validate Persian alphabet, unique and max to 25 characters\n\n  'age'           =\u003e 'persian_num|required',  // Validate Persian numbers and check it's required\n\n  'city'          =\u003e 'persian_alpha_num|min:10',  // Validate persian alphabet \u0026 numbers at least 10 digit accepted\n\n  'mobile'        =\u003e 'iran_mobile', // Validate mobile number\n\n  'sheba_number'  =\u003e 'sheba', // Validate sheba number of bank account\n\n  'melli_code'    =\u003e 'melli_code',  // Validate melli code number\n\n  'latin_name'    =\u003e 'is_not_persian',  // Validate alphabet and doesn't contain Persian alphabet or number\n\n  'your_array'    =\u003e 'limited_array:2', // Validate your array variable and must be contian 2 member or lesser\n\n  'url'           =\u003e 'a_url', // Validate url\n\n  'domain'        =\u003e 'a_domain',  // Validate domain\n\n  'more'          =\u003e 'more:10', // Validate value be more than parameter\n\n  'less'          =\u003e 'less:10', // Validate value be less than parameter\n\n  'phone'         =\u003e 'iran_phone', // Validate phone number\n\n  'card_number'   =\u003e 'card_number', // Validate payment card number\n\n  'address'       =\u003e 'address' // validate Persian, English and ... alphabet, Persian and English numbers and some special characters\n\n  'postal_code'   =\u003e 'iran_postal_code' // validate iran postal code format\n\n  'package_name'  =\u003e 'package_name' // validate APK package name\n\n\n]);\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencafe%2Fvalidation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencafe%2Fvalidation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencafe%2Fvalidation/lists"}