1. Go to this page and download the library: Download esponsor/dni-validator 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/ */
esponsor / dni-validator example snippets
use Esponsor\DniValidator\CpfBrazil;
use Esponsor\DniValidator\RutChile;
$rut = new RutChile();
$rut->validate('11.111.111-1'); // true
$rut->clean('11.111.111-1'); // '111111111'
$rut->format('111111111'); // '11.111.111-1'
$cpf = new CpfBrazil();
$cpf->validate('111.444.777-35'); // true
$cpf->format('11144477735'); // '111.444.777-35'
use Esponsor\DniValidator\Rules\CpfBrazilRule;
use Esponsor\DniValidator\Rules\RutChileRule;
$request->validate([
'rut' => ['