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