jeffersonsimaogoncalves / input-mask
A Laravel Nova custom field text with masks on input
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 1 070
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 0
Forks: 5
Language:Vue
pkg:composer/jeffersonsimaogoncalves/input-mask
Requires
- php: >=7.1.0
README
Nova custom field text with masks.
Nova custom field text with masks. It uses vue-the-mask to implement mask directive to input field.
Installation
composer require jeffersonsimaogoncalves/input-mask
Usage
Import it in your resources and add the InputMask to fields method.
use Wemersonrv\InputMask\InputMask; public function fields(Request $request) { return [ ID::make('ID', 'id')->sortable(), Text::make('Name', 'name'), InputMask::make('CPF', 'cpf') ->mask('###.###.###-##') // 111.222.333.44 ->raw(), // 11122233344 ]; }
Methods
This custom field has only two method:
mask('###...')Implement the mask on your input field;raw()If you want to save your value without mask, just add this method.
TODO List
- Apply mask to index and detail fields
- Create a set of predefined custom fields from InputMask with validation
- Brazilian CPF
- Brazilian CNPJ
- Brazilian Zip code (CEP)
- Brazilian landline phone
- Brazilian mobile phone with 9 digit
Release History
- 0.1.2
- Fix license in
composer.jsonfrom GPLv3 to GPL-3.0-or-later
- Fix license in
- 0.1.1
- Fix license in
composer.jsono GPLv3
- Fix license in
- 0.1.0
- The First Oficial release
- CHANGE: Nothing important.
- ADD: button badge for github release
- 0.0.1
- Work in progress
References
- Laravel Framework
- Laravel Nova
- Vue-the-Mask
Meta
Wemerson Guimarães – @WemersonCG – wemersonrv@gmail.com
Distributed under the GPLv3 license. See LICENSE.md for more information.
