vesperabr/fieldtize
最新稳定版本:0.1.0
Composer 安装命令:
composer require vesperabr/fieldtize
包简介
Parse, validate and format fields easily.
README 文档
README
Parse, validate and format common fields in an easy way.
Installation
You can install the package via composer:
$ composer require vesperabr/fieldtize
Methods
Every field class has at least this methods:
make()Returns the field class instance.original()Returns the original value passed to the class.get()Returns the formatted value or null if value is invalid.raw()Returns the value without any masks or null if value is invalid.isValid()Returns true or false if value is invalid.
Fields
Phone
use Vespera\Fieldtize\Fields\Phone; $phone = Phone::make('1144443333'); $phone->original(); // '1144443333' $phone->get(); // '(11) 4444-3333' $phone->raw(); // '+551144443333' $phone->isValid(); // true echo $phone; // '(11) 4444-3333'
Todo
- Phone field:
getUri()method - Phone field:
getWhatsappUri()method - Phone field:
getInternationalNumber()method - Phone field:
getType()method - Phone field:
getCountry()method - CPF field
- CNPJ field
- CPF/CNPJ field
- CEP field
- E-mail field
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-31