Download the PHP package leandrocfe/filament-ptbr-form-fields without Composer

On this page you can find all versions of the php package leandrocfe/filament-ptbr-form-fields. 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 filament-ptbr-form-fields

Brazilian pt-BR form fields.

This package provides custom form fields for Filament that are commonly used in Brazilian web applications, such as CPF/CNPJ validation, phone number formatting, money with currency symbol, and CEP integration with ViaCep.

This package uses LaravelLegends/pt-br-validator to validate Brazilian Portuguese fields.

image demo

Installation

You can install the package via Composer:

Filament V2 - if you are using Filament v2.x, you can use this section

Usage

CPF / CNPJ

To create a dynamic input that accepts either CPF or CNPJ, use:

If you want to create an input that only accepts CPF or only accepts CNPJ, use:

If you want to use a custom mask for the input, use the cpf() or cnpj() method with a string argument representing the desired mask:

Validation

Document uses LaravelLegends/pt-br-validator to validate Brazilian Portuguese fields by default - cpf_ou_cnpj | cpf | cnpj

You can disable validation using the validation(false) method:

Phone number

To create a dynamic input that formats phone numbers with DDD, use:

If you want to use a custom phone number format, use the `mask() method with a string argument representing the desired format:

Money

To create a money input field, use the following syntax:

This is suitable for use with decimal or float data types.

Using Integer Values

If you prefer to work with integer values, you can format the money input using the intFormat() method:

Getting the Raw State

To retrieve the raw state of the field, you can use the `dehydratedMask() method:

If you need to remove the prefix from the money input, simply pass null to the prefix() method:

Currency Formatting

This package leverages the archtechx/money package under the hood. By default, it uses the BRL (Brazilian Real) format for currency values.

If you want to switch to the USD (United States Dollar) format, you can do so with the following code:

You can also define custom currencies to suit your specific needs:

Address

To integrate with the ViaCep API for CEP validation and address autofill, use:

The mode parameter specifies whether the search action should be appended to or prepended to the CEP field, using the values suffix or prefix. Alternatively, you can use the none value with the ->live(onBlur: true) method to indicate that the other address fields will be automatically filled only when the CEP field loses focus.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover a security vulnerability within this package, please send an e-mail to [email protected].

Credits

License

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


All versions of filament-ptbr-form-fields with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1 || ^8.2 || ^8.3
archtechx/money Version ^0.5.1
filament/filament Version ^3.0
illuminate/contracts Version ^10.0 || ^11.0
laravellegends/pt-br-validator Version ^10.0 || ^11.0
moneyphp/money Version ^4.5
spatie/laravel-package-tools Version ^1.14.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 leandrocfe/filament-ptbr-form-fields contains the following files

Loading the files please wait ....