PHP code example of iamfarhad / validation

1. Go to this page and download the library: Download iamfarhad/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/ */

    

iamfarhad / validation example snippets


// in a `FormRequest`

public function rules()
{
    return [
        'NationalCode' => ['
bash
php artisan vendor:publish --provider="Iamfarhad\Validation\ValidationRulesServiceProvider" --tag="translations"

bash
php artisan vendor:publish --provider="Iamfarhad\Validation\ValidationRulesServiceProvider"
 php
Validator::make(
    ['num' => '۰۱۲۳۴۵۶۷۸۹'],
    ['num' => [new PersianNumber()]
);
 php
Validator::make(
    ['mob' => '09127777777'],
    ['mob' => [new Mobile()]
);
 php
Validator::make(
    ['sheba_number' => 'IR062960000000100324200001'],
    ['sheba_number' => [new Sheba()]
);
 php
Validator::make(
    ['codeMelli' => '3240175800'],
    ['codeMelli' => [new NationalCode()]
);
 php
Validator::make(
    ['card' => '6274129005473742'],
    ['card' => [new CardNumber()]
);
 php
Validator::make(
    ['postal' => '16719735744'],
    ['postal' => [new PostalCode()]
);