PHPackages                             innovaweb/chileanrut - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. innovaweb/chileanrut

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

innovaweb/chileanrut
====================

A Chilean Rut script to handle ruts

v1.5.0(3y ago)1559MITPHP

Since Aug 26Pushed 3y ago2 watchersCompare

[ Source](https://github.com/innovawebcl/chilean-rut-php)[ Packagist](https://packagist.org/packages/innovaweb/chileanrut)[ Docs](https://github.com/innovawebcl/chilean-rut-php)[ RSS](/packages/innovaweb-chileanrut/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

ChileanRut
==========

[](#chileanrut)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c16d2674c60705a1979d188e9852e144e817b86e6a49e6db0495a243a4f3056b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e6e6f76617765622f6368696c65616e7275742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/innovaweb/chileanrut)[![Total Downloads](https://camo.githubusercontent.com/dbf8b014894d9fcdc8e6b769b4a0caab7956c21115c753292a19ffbd79cb9fcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6e6f76617765622f6368696c65616e7275742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/innovaweb/chileanrut)

A Chilean Rut script to handle ruts. Take a look at [contributing.md](contributing.md) to see a to do list.

Installation
------------

[](#installation)

Via Composer

```
$ composer require innovaweb/chileanrut
```

Usage
-----

[](#usage)

### Format Function

[](#format-function)

Format the rut according to the assigned parameters, if withDotted is true it will always return with a hyphen, return string value

ParamsTypeDescription$rutstringrut with any of these formats 11.111.111-1, 11111111-1, 111111111$withDottedboolreturn rut with dots format, default true$withHyphenboolreturn rut with hyphen format. default true```
Rut::format('123123123'); // return 12.312.312-3
Rut::format('123123123', false); // return 12312312-3
Rut::format('123123123', false, false); // return 123123123 (it is best to use the unformat function)
```

### Unformat Function

[](#unformat-function)

Clean the rut of spaces, dots and hyphens, return string value

ParamsTypeDescription$rutstringrut with any of these formats 11.111.111-1, 11111111-1, 111111111```
Rut::unformat('12.312.312-3'); // return 123123123
```

### Validate Function

[](#validate-function)

Check if the code is valid with the validation algorithm, return boolean value

ParamsTypeDescription$rutstringrut with any of these formats 11.111.111-1, 11111111-1, 111111111```
Rut::validate('12.312.312-3'); // return true
```

### Calculate Dv Function

[](#calculate-dv-function)

Calculates the check digit from a sequential rut number, return string value

ParamsTypeDescription$numberintonly the number of rut as integer type```
Rut::calculateDv(12312312); // return 3
```

### Get Number Function

[](#get-number-function)

Extract the numerical part of the rut, can return with points according to the parameters, return string value

ParamsTypeDescription$rutstringrut with any of these formats 11.111.111-1, 11111111-1, 111111111$withDottedboolreturn rut with dots format, default true```
Rut::getNumber('12312312-3'); // return 12312312
Rut::getNumber('12312312-3', true); // return 12.312.312
```

### Get Dv Function

[](#get-dv-function)

Extract the check digit part of the rut, return string value

ParamsTypeDescription$rutstringrut with any of these formats 11.111.111-1, 11111111-1, 111111111```
Rut::getDv('12312312-3'); // return 3
```

### Example

[](#example)

```
namespace App\Http\Controllers;

use Innovaweb\ChileanRut\Rut;

class RutController extends Controller
{
    public function index()
    {
        $format = Rut::format('123123123');
        $unformat = Rut::unformat($format);
        return [
            $format,
            $unformat,
            Rut::validate($unformat),
            Rut::calculateDv(12312312),
            Rut::getNumber($format, false),
            Rut::getDv($format),
        ];
    }
}
```

Result

```
[
  "12.312.312-3",
  "123123123",
  true,
  "3",
  "12312312",
  "3"
]
```

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Alejandro Isla](https://github.com/innovawebcl)
- [All Contributors](../../contributors)

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~58 days

Recently: every ~73 days

Total

6

Last Release

1428d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb10db2c683da7b54ef4dd41d33a46e34e3b3ab306c2d97daad9adb2b4380959?d=identicon)[Willywes](/maintainers/Willywes)

---

Top Contributors

[![Willywes](https://avatars.githubusercontent.com/u/4291325?v=4)](https://github.com/Willywes "Willywes (8 commits)")

---

Tags

laravelrutchileanrutRut ChilenoValidar RutFormatear RutCalcular Rut

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/innovaweb-chileanrut/health.svg)

```
[![Health](https://phpackages.com/badges/innovaweb-chileanrut/health.svg)](https://phpackages.com/packages/innovaweb-chileanrut)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[sunspikes/clamav-validator

Custom Laravel 5 anti-virus validator for file uploads.

3651.8M3](/packages/sunspikes-clamav-validator)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
