Package Data | |
---|---|
Maintainer Username: | mathiasd88 |
Maintainer Contact: | mathiasd88@gmail.com (Mathias Donoso) |
Package Create Date: | 2016-06-19 |
Package Last Update: | 2018-05-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-21 15:00:03 |
Package Statistics | |
---|---|
Total Downloads: | 12 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
A Chilean RUT credentials package for PHP 5.6+.
Require this package with composer:
composer require mathiasd88/chilean-credentials
Then use the class wherever you want using:
use Mathiasd88\ChileanCredentials\Rut;
If you want to validate a rut:
return (new Rut('15082666', '7'))->isValid(); // returns true
return (new Rut('15082666', 'K'))->isValid(); // returns false
If you want to get the "digito verificador" of a given rut:
return (new Rut('15082666'))->dv(); // returns 7
If you want to create a valid rut:
return new Rut(); // returns a valid rut, for example: '23932394-4'
You can run all the tests using phpunit.
vendor/phpunit/phpunit/phpunit tests --colors