PHP code example of pfrug / validate-document-uy

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

    

pfrug / validate-document-uy example snippets


// config/app.php
'providers' => [
    ...
    Pfrug\ValidateDocumentUy\ValidateCIServiceProvider::class,
];

// config/app.php
'aliases' => [
    ...
    'ValidateCI' => Pfrug\ValidateDocumentUy\Facades\ValidateCI::class,
];

ValidateCI::isValid('30780892'); // true
ValidateCI::isValid('3.078.089-2'); // true
ValidateCI::isValid('30780890'); // false
ValidateCI::controlDigit('3078089'); // 2
ValidateCI::gerRandomDocument(); 

$validator = Validator::make($data, [
    'document1' => 'validate_ci',         // Using shorthand notation
    'document2' => new DocumentUyRule(), // Using custom rule class    
]);
sh
 php artisan vendor:publish --tag="validate-document-uy"