henriquemattia / moeda-br
A Laravel Nova custom mask field for the brazilian currency.
Installs: 6 066
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Language:Vue
Requires
- php: ^7.3|^8.0
README
Mask field for brazilian currency
Install
Run this command into your nova project:
composer require henriquemattia/moeda-br
Add it to your Nova Resource:
use Henriquemattia\MoedaBr\MoedaBr; MoedaBr::make('Valor', 'value'),
Optional Methods
You can customize the behavior of the field using the following methods:
-
Multiply the value by a factor:
Use the
multiplyValueBy
method to multiply the input value by a specific integer. For example, to multiply the value by 100:MoedaBr::make('Valor', 'value')->multiplyValueBy(100),
-
Display the value divided by a factor:
Use the
displayValueDividedBy
method to divide the displayed value by a specific integer. This is useful when you want to format or scale the value for display purposes. For example, if you want to display the value divided by 100:MoedaBr::make('Valor', 'value')->displayValueDividedBy(100),