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


use Pfrug\ValidateDocumentUy\Providers\ValidateDocumentUyServiceProvider;

$app->register(ValidateDocumentUyServiceProvider::class);

$request->validate([
    'document' => '

use Pfrug\ValidateDocumentUy\Rules\ValidUruguayanCiRule;

$request->validate([
    'document' => ['

use Pfrug\ValidateDocumentUy\Facades\ValidateDocumentUy;

ValidateDocumentUy::isValid('12345672'); // true
ValidateDocumentUy::controlDigit('1234567'); // returns 2
ValidateDocumentUy::generateRandomDocument(); // returns a valid CI string
bash
php artisan vendor:publish --tag=validate-document-uy

resources/lang/vendor/validate-document-uy/en/validation.php
resources/lang/vendor/validate-document-uy/es/validation.php

src/
├── Facades/
│   └── ValidateDocumentUy.php
├── Providers/
│   └── ValidateDocumentUyServiceProvider.php
├── Rules/
│   └── ValidUruguayanCiRule.php
├── Services/
│   └── UruguayanCiValidator.php
├── Support/
│   └── ValidatesUruguayanCi.php