wemersonrv/input-mask
A Laravel package that adds input masking to forms via Blade components, with ready-to-use masks for CPF/CNPJ, phone, date, currency, and custom patterns.
Architecture fit — conditional, and narrower than the package claims. The description frames this as a general-purpose Laravel masking library with Blade directives and helpers. The repository is a Laravel Nova custom field: one PHP Field subclass that passes mask metadata plus a Vue component that renders the masked input inside Nova's admin UI. It contributes nothing to Blade, Livewire, Inertia, API resources, or validation. Architecturally it is a presentation-layer widget with no domain-layer surface, no service provider capability, and no extension point beyond the frontend component. Fit is therefore binary: if the target surface is a Nova resource form, it fits; anything else, it does not.
Integration feasibility — small but time-boxed to a specific Nova era. The whole package is two files plus a bundled JS mask library, so the read-and-understand cost is hours, not days. Feasibility hinges on one fact: last release 2019-05-16 places it in the Nova 1.x/2.x, Vue 2 generation. On a legacy Nova install, integration is a composer require, a field registration, and an asset publish. On Nova 4/5 the frontend is Vue 3 and the component is a rewrite, at which point "integrate" collapses into "rebuild using this as a reference." Composer constraints and asset-pipeline assumptions from 2019 are the second-order friction.
Technical risk — four independent risks, none of which the package mitigates.
LIKE, join, or export assuming digits will be silently wrong unless normalization is added independently of the package.Key questions to resolve before any sprint commitment.
Stack fit. Nova-only. The PHP class is a metadata carrier; all behavior lives in resources/js/. That means the integration surface is (a) field registration in fields(), (b) asset publishing, and (c) the frontend component. There is nothing to wire into controllers, jobs, commands, or API layers, and no runtime coupling to application code beyond the admin bundle.
Migration path — two viable shapes, pick deliberately.
App\Nova\Fields\MaskedText with fluent helpers (->phone(), ->document()). Every call site references our class, so swapping or porting later touches one file. Pair it with prepareForValidation() normalization in the FormRequest and displayUsing() formatters on index/detail, so the stored value is canonical digits and the mask is re-applied only at render time.nova-components/, replace the bundled mask plugin with a maintained one (IMask or cleave.js), target Vue 3, and own the rebuild. Estimated 1–2 engineering days. This yields Nova-version compatibility, an MIT-clean license, and a mask library we selected.The rule that survives either path: masks are presentation only; server-side validation plus a normalizer is mandatory and belongs to us, not the package.
Compatibility. Verify in this order: Nova major → composer.json constraints (laravel/nova, PHP) → package.json bundled mask library name/version/license → asset build (nova:publish, npm run dev) → browser behavior. Then run the spike matrix against the exact formats we intend: type, paste a pre-formatted value, paste an unformatted value, clear the field, submit empty, submit via autofill. Mask libraries diverge sharply on each of these and the README tells us nothing.
Sequencing.
Maintenance. There is no upstream maintenance to inherit — only a liability to contain. Adopting means committing to a private fork, an exact version pin, a named owner in the dependency inventory, and remediation at every Nova major upgrade (every one of which will require touching the Vue component). The realistic steady-state cost is not the initial integration but the recurring port. For a 1–2 day rebuild, the break-even against "own a 2019 fork forever" is immediate.
Support. No maintainer, no security response path, no issue community, no upgrade commitments. All triage is internal. Because the documentation is unreliable, the source remains the de facto runbook — which is fine at two files, but it means the knowledge sits with whoever read them. Encode it in the wrapper class and an internal README so it does not become tribal.
Scaling. Technically this is a non-issue: a single admin field with no server-side request cost beyond the existing Nova bundle, no background work, no external calls. The scaling concern is organizational — every resource that registers the raw vendor field multiplies the later port and the normalization surface. The wrapper class is what keeps that linear instead of combinatorial, and the normalization layer is what keeps data quality independent of how many fields are masked.
Failure modes to instrument for.
$field->meta() in fields() to confirm metadata reaches the frontend, then check the Nova console for a failed Nova.booting registration. Usually Vue version mismatch or unbundled assets, not mask config.Ramp-up. A developer already fluent in Nova fields is productive in hours on the adopt path; days if porting the Vue component. Legal review is calendar time, not effort, and it should be started before the spike rather than after — it is the most likely source of schedule slippage on a package this small. Onboarding cost concentrates in one place: whoever owns the fork owns an undocumented, unmaintained 2019 frontend component, so assign that ownership explicitly at decision time rather than inheriting it by default.
How can I help you explore Laravel packages today?