Skip to content

Commit de16ab4

Browse files
committed
wip
1 parent 2b4e319 commit de16ab4

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

README.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This package provides custom form fields for [Filament](https://filamentphp.com/
44

55
This package uses [LaravelLegends/pt-br-validator](https://github.com/LaravelLegends/pt-br-validator) to validate Brazilian Portuguese fields.
66

7-
![image demo](https://raw.githubusercontent.com/leandrocfe/filament-ptbr-form-fields/develop/screenshots/v3-example.png)
7+
![image demo](https://raw.githubusercontent.com/leandrocfe/filament-ptbr-form-fields/develop/screenshots/v3x-example.png)
88

99
## Installation
1010

@@ -114,8 +114,8 @@ If you prefer to work with integer values, you can format the money input using
114114
```php
115115
use Leandrocfe\FilamentPtbrFormFields\Money;
116116
Money::make('price')
117-
->default(10000)
118-
->intFormat()
117+
->default(10000)
118+
->intFormat()
119119

120120
#output: 10000
121121
```
@@ -126,16 +126,16 @@ To retrieve the raw state of the field, you can use the `dehydratedMask() method
126126
```php
127127
use Leandrocfe\FilamentPtbrFormFields\Money;
128128
Money::make('price')
129-
->default('100,00')
130-
->dehydrateMask()
129+
->default('100,00')
130+
->dehydrateMask()
131131

132132
#output: 100,00
133133
```
134134

135135
If you need to remove the prefix from the money input, simply pass null to the `prefix()` method:
136136
```php
137137
Money::make('price')
138-
->prefix(null)
138+
->prefix(null)
139139
```
140140
#### Currency Formatting
141141

@@ -146,13 +146,19 @@ If you want to switch to the `USD` (United States Dollar) format, you can do so
146146
use Leandrocfe\FilamentPtbrFormFields\Currencies\USD;
147147

148148
Money::make('price')
149-
->currency(USD::class)
150-
->prefix('$')
149+
->currency(USD::class)
150+
->prefix('$')
151151
```
152152

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

155+
155156
```php
157+
158+
/*
159+
* app/Currencies/EUR.php
160+
*/
161+
156162
declare(strict_types=1);
157163

158164
namespace App\Currencies;
File renamed without changes.

0 commit comments

Comments
 (0)