PHP code example of sadegh19b / laravel-persian-validation
1. Go to this page and download the library: Download sadegh19b/laravel-persian-validation library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sadegh19b / laravel-persian-validation example snippets bash
php artisan vendor:publish --provider="Sadegh19b\LaravelPersianValidation\PersianValidationServiceProvider"
php
$input = [ 'فارسی' ];
$rules = [ 'persian_alpha' ];
Validator::make( $input, $rules );
php
$input = [ '۰۱۲۳۴۵۶۷۸۹' ];
$rules = [ 'persian_num' ];
Validator::make( $input, $rules );
php
$input = [ '۰فارسی۱۲۳۴۵۶۷۸۹' ];
$rules = [ 'persian_alpha_num' ];
Validator::make( $input, $rules );
php
$input = [ '۰فارسی۱۲۳۴۵6789' ];
$rules = [ 'persian_alpha_eng_num' ];
Validator::make( $input, $rules );
php
$input = [ '1373/3/19' ];
$rules = [ 'shamsi_date' ];
Validator::make( $input, $rules );
php
$input = [ '1373/3/19' ];
$rules = [ 'shamsi_date_between:1300,1400' ];
Validator::make( $input, $rules );
php
$input = [ '09381234567' ];
$rules = [ 'ir_mobile' ];
Validator::make( $input, $rules );
php
$input = [ 'IR062960000000100324200001' ];
$rules = [ 'ir_sheba' ];
Validator::make( $input, $rules );
php
$input = [ '3240175800' ];
$rules = [ 'ir_national_code' ];
Validator::make( $input, $rules );
php
$input = [ '6274129005473742' ];
$rules = [ 'ir_bank_card_number' ];
Validator::make( $input, $rules );
php
$input = [ '167197-35744' ];
$rules = [ 'ir_postal_code' ];
Validator::make( $input, $rules );
or
$input = [ '16719735744' ];
$rules = [ 'ir_postal_code' ];
Validator::make( $input, $rules );
php
$input = [ '14007650912' ];
$rules = [ 'ir_company_id' ];
Validator::make( $input, $rules );