PHPackages                             zen0x7/masked-field - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. zen0x7/masked-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zen0x7/masked-field
===================

A Laravel Nova field.

021Vue

Since Jan 4Pushed 1y agoCompare

[ Source](https://github.com/Zen0x7/laravel-nova-masked-field)[ Packagist](https://packagist.org/packages/zen0x7/masked-field)[ RSS](/packages/zen0x7-masked-field/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Nova Masked Field
=========================

[](#laravel-nova-masked-field)

> This is a fork for version 5.0.
>
> The only three things that was made was:
>
> - Nova ^5.0 was added to the composer.json.
> - Readme was modified.

Installation
------------

[](#installation)

```
composer require zen0x7/masked-field:dev-main
```

Basic Usage
-----------

[](#basic-usage)

To use the Laravel Nova Masked Field, follow these steps:

1. Import the MaskedField class in your Nova resource file:

```
use Greg0x46\MaskedField\MaskedField;
```

2. Add the MaskedField to the fields method of your resource file:

```
public function fields(Request $request)
{
    return [
        MaskedField::make('Phone')
            ->mask('(###) ###-####'),
    ];
}
```

[![masked-field-demo](https://user-images.githubusercontent.com/16712150/200448755-d3fcc39b-28b6-4145-bbd0-f2d5c8e23713.png)](https://user-images.githubusercontent.com/16712150/200448755-d3fcc39b-28b6-4145-bbd0-f2d5c8e23713.png)

Usage with dependsOn
--------------------

[](#usage-with-dependson)

You can also use the dependsOn method to set a conditional mask based on the value of another field. Here's an example:

```
use Greg0x46\MaskedField\MaskedField;

public function fields(Request $request)
{
    return [
        MaskedField::make('Phone', 'phone')
            ->mask('(###) ###-####')
            ->dependsOn(['country'], function (MaskedField $field, NovaRequest $request, FormData $formData) {
                if($formData->country == 'BR')
                    $field->mask('(##) ####-####');
            })
    ];
}
```

Mask syntax
-----------

[](#mask-syntax)

The Laravel Nova Masked Field uses a mask syntax to define patterns for input formatting. Here are the default tokens available:

```
{
    '#': { pattern: /[0-9]/ },
    'X': { pattern: /[0-9a-zA-Z]/ },
    'S': { pattern: /[a-zA-Z]/ },
    'A': { pattern: /[a-zA-Z]/, uppercase: true },
    'a': { pattern: /[a-zA-Z]/, lowercase: true },
    '!': { escape: true },
    '*': { repeat: true }
}
```

You can refer to the [beholdr/maska](https://github.com/beholdr/maska) repository for more information on the mask syntax.

References
----------

[](#references)

- It is a custom field for [Laravel Nova](https://nova.laravel.com/)
- It uses [beholdr/maska](https://github.com/beholdr/maska)
- It is inpired by [wemersonrv/input-mask](https://novapackages.com/packages/wemersonrv/input-mask)

Notice Regarding Nova License
-----------------------------

[](#notice-regarding-nova-license)

Hey everyone,

My Nova license expired in November 2023 for version [v4.29.2](https://nova.laravel.com/releases/4.29.2), which is the last version I have access to. Currently, I don't have plans to renew it, so unfortunately, I won't be able to assist with issues related to updates or newer Nova features. Feel free to seek alternative support or solutions with other users or maintainers.

Thank you for your understanding.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity16

Early-stage or recently created project

 Bus Factor1

Top contributor holds 53.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b3a818109c3c37589944261c679e7b61e07283e56948f83760cc3d709842609e?d=identicon)[zen0x7](/maintainers/zen0x7)

---

Top Contributors

[![greg0x46](https://avatars.githubusercontent.com/u/16712150?v=4)](https://github.com/greg0x46 "greg0x46 (7 commits)")[![Zen0x7](https://avatars.githubusercontent.com/u/8731267?v=4)](https://github.com/Zen0x7 "Zen0x7 (4 commits)")[![fzamperin](https://avatars.githubusercontent.com/u/2280530?v=4)](https://github.com/fzamperin "fzamperin (2 commits)")

### Embed Badge

![Health badge](/badges/zen0x7-masked-field/health.svg)

```
[![Health](https://phpackages.com/badges/zen0x7-masked-field/health.svg)](https://phpackages.com/packages/zen0x7-masked-field)
```

###  Alternatives

[vcian/pulse-active-sessions

A Laravel Pulse card to show active user session.

11469.2k](/packages/vcian-pulse-active-sessions)[norberttech/aceeditor-bundle

Bundle that integrate excellent JavaScript ace editor into Symfony Form.

28310.8k](/packages/norberttech-aceeditor-bundle)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)[chefkoch/morphoji

A library to convert UTF-8 emoji characters to latin1 placeholders and vice versa.

14136.9k1](/packages/chefkoch-morphoji)[epessine/axis

Draw charts with a simple API on Laravel

265.6k](/packages/epessine-axis)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
