michaeld555/ filament-fields
用于filament形式的filament巴西字段
v1.0.1
2024-09-27 19:47 UTC
Requires
- php: >=8.0
- filament/filament: ^3.0
- illuminate/contracts: ^10.0 || ^11.0
- laravellegends/pt-br-validator: ^10.0 || ^11.0
- spatie/laravel-package-tools: ^1.14.0
This package is auto-updated.
Last update: 2024-09-27 19:48:41 UTC
README
安装
在您的composer.json中要求此包,并更新composer。这将下载该包。
composer require michaeld555/filament-fields
使用字段
要创建一个货币输入,使用
use Michaeld555\MoneyInput; MoneyInput::make('value') ->prefix('R$')
要创建一个CEP输入,使用
use Michaeld555\CepInput; Cep::make('postal_code') ->viaCep( mode: 'suffix', // Determines whether the action should be appended to (suffix) or prepended to (prefix) the cep field, or not included at all (none). errorMessage: 'CEP inválido.', // Error message to display if the CEP is invalid. /** * Other form fields that can be filled by ViaCep. * The key is the name of the Filament input, and the value is the ViaCep attribute that corresponds to it. * More information: https://viacep.com.br/ */ setFields: [ 'street' => 'logradouro', 'number' => 'numero', 'complement' => 'complemento', 'district' => 'bairro', 'city' => 'localidade', 'state' => 'uf' ], citiesTable: 'cities', // if you want to set a field with information from your cities table in the database ibgeColumn: 'igbe_code', // the name of your column in the cities database that receives the IBGE code ),