-
Hi All. I got error when masking textinput for money in filament 3
Target class [Filament\Forms\Components\TextInput\Mask] does not exist. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Sadly there is no Mask class anymore https://filamentphp.com/docs/3.x/forms/fields/text-input#input-masking But you could try copying it into your own project and see if it works still Or you can use the new RawJs helper and just directly call the alpine money mask TextInput::make('price')
->mask(RawJs::make(<<<'JS'
$money($input, '.', ',', 2)
JS
)) |
Beta Was this translation helpful? Give feedback.
-
At the end of the Filament documentation section @sinnbeck referred to, there's a very useful code snippet specific to money-handling which worked nicely for me...
|
Beta Was this translation helpful? Give feedback.
Sadly there is no Mask class anymore
https://filamentphp.com/docs/3.x/forms/fields/text-input#input-masking
But you could try copying it into your own project and see if it works still
https://github.com/filamentphp/forms/blob/2.x/src/Components/TextInput/Mask.php
Or you can use the new RawJs helper and just directly call the alpine money mask
https://alpinejs.dev/plugins/mask#money-inputs