aristidesneto/helpers

Helpers and validations classes

v1.0.0 2021-06-05 18:41 UTC

This package is auto-updated.

Last update: 2024-11-06 02:58:46 UTC


README

Latest Version on Packagist Total Downloads

Conjunto de classes de Helpers e Validations para otimizar sua aplicação.

Instalação

Instale o pacote via composer:

composer require aristidesneto/helpers

Uso

require __DIR__ . '/vendor/autoload.php';

use Aristides\Helpers\Helpers;
use Aristides\Helpers\Validations;

// Validações
Validations::cpf('123.456.789-10'); // true or false

Validations::cnpj('11222333444455'); // true or false

Validations::email('contato@email.com') // true or false

// Helpers
Helpers::formatMoneyToReal('1485.48'); // 1.485,48
Helpers::formatMoneyToReal('873.11', true); // R$ 873,11

Helpers::formatMoneyToDatabase('45.367,98'); // 45367.98
Helpers::formatMoneyToDatabase('R$ 88.475.411,89'); // 88475411.89

Helpers::transformMonth(3); // Março
Helpers::transformMonth(3, false); // Mar

Helpers::transformWeekDays(2); // Segunda-feira
Helpers::transformWeekDays(2, false); // Seg

Helpers::mask('(##) #####-####', '12999887766'); // (12) 99988-7766
Helpers::mask('##.###.###/####-##', '41636863000137'); // 41.636.863/0001-37

Testes

composer test

Contribuindo

Veja CONTRIBUTING para mais detalhes.

License

The MIT License (MIT). Please see License File for more information.