PHP code example of luilliarcec / laravel-ecuador-identification

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

    

luilliarcec / laravel-ecuador-identification example snippets


$request->validate([
    'identification' => 'ecuador:natural_ruc',
]);

$validator = Validator::make($request->all(), [
    'identification' => 'ecuador:natural_ruc',
]);

use Luilliarcec\LaravelEcuadorIdentification\Facades\EcuadorIdentification;

EcuadorIdentification::validateNaturalRuc('1710034065001'); // Return null or string code

$request->validate([
    'identification' => 'ecuador:personal_identification',
]);

use Luilliarcec\LaravelEcuadorIdentification\Facades\EcuadorIdentification;

EcuadorIdentification::validateAllTypeIdentification('9999999999999'); // Return '07' => Final Consumer

    
    return [
        ...

        'ecuador' => 'The :attribute field does not have the corresponding country format. (Ecuador)',
    
        /*
        |--------------------------------------------------------------------------
        | Custom Validation Attributes
        |--------------------------------------------------------------------------
        |
        | The following language lines are used to swap our attribute placeholder
        | with something more reader friendly such as "E-Mail Address" instead
        | of "email". This simply helps us make our message more expressive.
        |
        */
    
        'attributes' => [
            'id' => 'Ecuadorian Identification',
        ],
    ];

    
    return [
        ...

        'ecuador' => 'El campo :attribute no tiene el formato de país correspondiente. (Ecuador)',
    
        /*
        |--------------------------------------------------------------------------
        | Custom Validation Attributes
        |--------------------------------------------------------------------------
        |
        | The following language lines are used to swap our attribute placeholder
        | with something more reader friendly such as "E-Mail Address" instead
        | of "email". This simply helps us make our message more expressive.
        |
        */
    
        'attributes' => [
            'id' => 'Identificación Ecuatoriana',
        ],
    ];