Download the PHP package freshwork/chilean-bundle without Composer

On this page you can find all versions of the php package freshwork/chilean-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package chilean-bundle

Chilean Bundle

A PHP composer package with Chilean validations, common variables, etc. Viva Chile Mier...

This package includes:

Installation

Step 1: Composer

From the command line, run:

If you're not using Laravel, you are done.

Step 2: Laravel Service Provider

If you're using Laravel 5.5 this package supports Auto-Discovery. So you can skip this step.

For Laravel 5.4 or below

Append this line to your providers array in your config/app.php file:

and you can add the RUT Facade

Usage

The Basics

You can use the RUT object, but I recommend using the Rut::parse() method.

The parse() method

Is the recommended way of using the object. It will automatically separate the Verification Number (Dígito verrificador) and the rest of the number.

The set() method

This is a shortcut for (new Rut($number, $vn))

The validate() & isValid() method

validate() is an alias of isValid()

Invalid Formatted R.U.T.

if the R.U.T. is invalid, it will return false

Invalid Formatted R.U.T.

if the R.U.T. has a wrong format, it will throw an Freshwork\ChileanBundle\Exceptions\InvalidFormatException

Quiet mode

You can prevent that the object throws an InvalidFormatException, so validate() will just return false, using the quiet() mehtod.

You can re-enable exceptions with use_exceptions()

The calculateVerificationNumber() method

You can get the correct verification number of a RUT. Note that the we are passing just one argument to the set() method. We are not defining a verification number.

Esta clase se basa en está simple, pero eficiente función: http://www.dcc.uchile.cl/~mortega/microcodigos/validarrut/php.php

The format() method

Return the Rut object as string with a definied format.

The normalize() method

If you are saving RUTs in the database, I recommend saving the normalized rut string. This method is an alias of ->format(Rut::FORMAT_ESCAPED)

The toArray() method

Return the Rut object as string with a definied format.

The fix() method

Fix the current RUT. It will take the number part of the RUT (without verification number) and it will calculate what's the correct verification number for that RUT and then updates the verification number with this result.

The vn() and number() method

You can set and get the RUT number and verification number with this methods. If no argumen are passed to this methods, it will return the corresponding value. Otherwise, it sets the value.

Laravel

Validations

If you're using the service Provider, you can validate ruts usign the validation system of Laravel using the cl_rut validation.


Examples

RUT Generator

This generates ten random RUT's between 1.000.000 and 25.000.000

Even a shorter syntaxis:


Licencia y Postalware

Puedes usar este paquete gratuitamente sin ninguna restricción, aunque como está de moda, implementamos una licencia 'Postalware'. Si usas este paquete en producción y te gusta como funciona, Agradeceríamos bastante si nos envías una postal de tu ciudad/comuna, una nota de agradecimiento o un súper8.

Dirección Nombre: Gonzalo De Spirito Providencia 229, Providencia. Chile,


Testing

You can run the tests as ./vendor/bin/codecept run


Contributing

Please, feel free to contact me at [email protected]


All versions of chilean-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package freshwork/chilean-bundle contains the following files

Loading the files please wait ....