mathiasd88/chilean-credentials

Chilean credentials package for PHP (Rut and Passport)
12
Install
composer require mathiasd88/chilean-credentials
PHP:>=5.6.0
License:MIT
Last Updated:May 21, 2018
Links: GitHub  ·  Packagist
Maintainer: mathiasd88

Framework Agnostic Chilean Credentials Package

Build Status

A Chilean RUT credentials package for PHP 5.6+.

Installation

Require this package with composer:

composer require mathiasd88/chilean-credentials

Then use the class wherever you want using:

use Mathiasd88\ChileanCredentials\Rut;

Usage

Examples:

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'

Tests

You can run all the tests using phpunit.

vendor/phpunit/phpunit/phpunit tests --colors

Related Packages

freshwork/chilean-bundle

A PHP composer package with Chilean validations, common variables, etc. (RUT, IV...

213,110 98
mirkco/laravel-passport-facebook-login

Facebook Token Request Grant for Laravel Passport

498 8
adaojunior/passport-social-grant

Social grant for Laravel Passport

288,144 116
mikemclin/passport-custom-request-grant

Custom Request Grant for Laravel Passport

3,698 34
moeen-basra/laravel-passport-mongodb

Laravel Passport provides OAuth2 server support to Laravel.

830 2