Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Masked Field

Masked Field Laravel Package

greg0x46/masked-field

Masked Field is a Laravel package for adding input masks to forms, making it easy to format and validate values such as phone numbers, dates, and documents. It offers reusable mask definitions and a clean, framework-friendly API for consistent user input.

View on GitHub
Deep Wiki
Context7

A Laravel Nova field that adds clean, client-side input masking to your forms. masked-field lets you format phone numbers, dates, document IDs, currency, and other structured values as users type—while storing the raw value your application expects. It plugs into Nova resources with a fluent API, so setup stays minimal and readable.

  • Configurable masks for phones, dates, currency, and custom patterns
  • Stores unmasked values while displaying formatted input
  • Fluent, chainable configuration within Nova resources
  • Works with existing validation and field options
Frequently asked questions about Masked Field
What is the greg0x46/masked-field package and what does it do?
Masked Field is a Laravel Nova custom field that displays sensitive values such as card numbers, phone numbers, or IDs in a masked format, typically revealing only the last few characters. Internally it is a thin packaging layer: a Vue field component plus a PHP class extending Laravel\Nova\Fields\Field. It is UI-only and scoped to Nova's admin panel, so it adds no backend behavior, validation, or formatting logic beyond what the field resolves to.
How do I install and use Masked Field in a Laravel Nova resource?
Install it with Composer using composer require greg0x46/masked-field, then register the field inside your Nova resource's fields method, for example MaskedField::make('Phone'). If the Vue component is not auto-registered, publish the package assets as described in the README. The wiring is low effort; the real cost is verifying it renders correctly against your exact Nova major version.
Which Laravel Nova versions does this masked field support?
Nova fields are tightly coupled to Nova's internal front-end contract, which uses Vue 2 on Nova 3 and Vue 3 on Nova 4 and 5, so a field built for one major line can fail silently or render unstyled on another. Check the laravel/nova constraint declared in the package's composer.json and confirm the PHP and Laravel constraints align with your application. Test the field on your exact Nova major before counting the integration as feasible.
Does Masked Field store the masked value or the original value in the database?
This is the most important behavior to verify in the source before adopting the package, because persisting the masked string instead of the raw value corrupts stored phone, card, or tax-ID data and breaks downstream validation and search. The field is intended as a presentational affordance, so keep the underlying database column independent of it. Treat the masked field as display and input sugar, not as the source of truth.
How do I configure which characters get masked?
The package advertises configurable masking, such as revealing only the last few characters, but the exact configuration API should be confirmed in the README and the PHP field class before you rely on method names. Read the Field subclass source to see which options are passed to the Vue component and how defaults are applied. Avoid assuming configuration methods exist until you have verified them in your installed version.
Is this package maintained and safe to use in production?
The technical evaluation flags a single maintainer, no organizational backing, no visible CI or test suite, 9 stars, and 0 dependents, which means essentially no third-party production validation. Because Nova is closed-source, breakage on upgrades tends to surface at runtime in the admin panel. Pin the version, review the PHP field class yourself, and keep the integration reversible by leaving the underlying column and validation rules independent of the field.
Does Masked Field work with Filament or Livewire instead of Nova?
No. The package is a Nova field and only registers inside a Nova resource; it is a no-op for API-only services, Inertia or Livewire front ends, and Filament-based admin panels. If you are on Filament, which is the more common modern choice, use its built-in formatting helpers or a client-side mask library instead. Confirm your stack is Laravel plus Nova on a supported major before spending integration time.
How should I validate masked input server-side in Laravel?
Keep your validation rules on the model or FormRequest, independent of the Nova field, and validate the raw value rather than the masked representation. Check whether the field supplies a rules-compatible value or whether the mask leaks into the request payload before trusting client-side masking as validation. Server-side validation should remain the authority regardless of how the field renders in Nova.
What are the alternatives to using a Nova masked field package?
Input masking is a commodity problem already solved by mature, widely deployed libraries such as imask, maska, and cleave.js, or by a short Alpine.js directive attached to a native input. For read-only display in Nova you can also use a closure with displayUsing or format the value in the resource rather than adding a dependency. Taking a supply-chain dependency on an unaudited package for a roughly 30-line affordance is a poor risk-to-value trade.
Is the masked field accessible and does it handle paste and screen readers?
Accessibility depends on whether the field renders a native input with a mask library attached or a custom rendered control, which materially affects screen-reader announcements and paste behavior. Review the Vue component source to see how it handles paste events, cursor position, and input type, and test with a screen reader and keyboard-only navigation. If it uses a custom control, prefer a native input-based alternative.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect