© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
gustavo.dev

Input masking

In version V2 of Filament, I had this mask:

->mask(fn (TextInput\Mask $mask) => $mask->pattern('{{ /^[0-9kK]*$/ }}'))
->mask(fn (TextInput\Mask $mask) => $mask->pattern('{{ /^[0-9kK]*$/ }}'))

But how can I achieve the same thing in the new version using the regular expression? I'm not sure why this expression doesn't work:

->mask(RawJs::make(<<<'JS'
    return '/^[0-9kK]*$/'
JS))
->mask(RawJs::make(<<<'JS'
    return '/^[0-9kK]*$/'
JS))

Could you please help me with this?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Input masking
FilamentFFilament / ❓┊help
3y ago
Custom Input use masking. (Money)
FilamentFFilament / ❓┊help
3y ago
Input Masking not rendering in Edit Mode
FilamentFFilament / ❓┊help
2y ago
How to get rid of some character in input when Masking?
FilamentFFilament / ❓┊help
3y ago