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\RutChile;
use Esponsor\DniValidator\CurpMexico;
$rut = new RutChile();
$rut->validate('11.111.111-1'); // true
$rut->validate('11.111.111-2'); // false
$rut->clean('11.111.111-1'); // '111111111'
$rut->format('111111111'); // '11.111.111-1'
$curp = new CurpMexico();
$curp->validate('GICJ020605HDGRHNA2'); // true
$curp->format('gicj020605hdgrhna2'); // 'GICJ020605HDGRHNA2'
use Esponsor\DniValidator\Rules\RutChileRule;
use Esponsor\DniValidator\Rules\CurpMexicoRule;
$request->validate([
'rut' => ['