PHPackages                             laradrax/nova-fields - 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. laradrax/nova-fields

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

laradrax/nova-fields
====================

A collection of fields for Laravel Nova.

v1.0.1(10mo ago)185MITPHPPHP ^8.4CI failing

Since Jul 7Pushed 1mo agoCompare

[ Source](https://github.com/laradrax/nova-fields)[ Packagist](https://packagist.org/packages/laradrax/nova-fields)[ RSS](/packages/laradrax-nova-fields/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

Nova Fields
===========

[](#nova-fields)

A collection of custom fields for Laravel Nova that provides advanced functionality for your resources.

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

[](#installation)

You can install the package via Composer:

```
composer require laradrax/nova-fields
```

Available Fields
----------------

[](#available-fields)

### 1. TextMask

[](#1-textmask)

Text field with masking functionality using the Maska library.

#### Features

[](#features)

- ✅ Custom mask patterns support
- ✅ Customizable tokens
- ✅ Eager mode (shows static characters before typing)
- ✅ Reversed mode (useful for currency and numbers)
- ✅ Raw value (without mask) on submission
- ✅ Integrated filtering

#### Basic Usage

[](#basic-usage)

```
use Laradrax\Nova\Fields\TextMask;

// Simple CPF mask
TextMask::make('CPF')
    ->mask('###.###.###-##'),

// Phone mask
TextMask::make('Phone')
    ->mask('(##) #####-####'),

// ZIP code mask
TextMask::make('ZIP')
    ->mask('#####-###'),
```

#### Available Methods

[](#available-methods)

```
// Set mask pattern
->mask('###.###.###-##')

// Custom tokens
->tokens([
    'X' => ['pattern' => '[0-9]', 'optional' => false],
    'Y' => ['pattern' => '[A-Z]', 'optional' => true]
])

// Eager mode (shows static characters)
->eager(true)

// Reversed mode (for numbers/currency)
->reversed(true)

// Raw value (without mask)
->raw(true)

// Require complete filling
->fillRequired(true)
```

#### Default Tokens

[](#default-tokens)

- `#` - Digit (0-9)
- `@` - Letter (a-z, A-Z)
- `*` - Alphanumeric

### 2. ActionLinks

[](#2-actionlinks)

Field that displays customizable action links with icons and styles.

#### Features

[](#features-1)

- ✅ Integrated SVG icons
- ✅ Predefined styles (colors)
- ✅ Open in new tab
- ✅ Customizable URLs
- ✅ Alignment options (left, center, right)

#### Basic Usage

[](#basic-usage-1)

```
use Laradrax\Nova\Fields\ActionLinks;
use Laradrax\Nova\Fields\ActionIcon;
use Laradrax\Nova\Fields\ActionColor;
use Laradrax\Nova\Fields\ActionAlign;

ActionLinks::make('Actions')
    ->addLink(
        label: 'View Details',
        url: '/custom-view/' . $this->id,
        icon: ActionIcon::VIEW,
        color: ActionColor::INFO,
        openInNewTab: true
    )
    ->addLink(
        label: 'Download PDF',
        url: '/download/' . $this->id,
        icon: ActionIcon::DOWNLOAD,
        color: ActionColor::SUCCESS
    )
    ->align(ActionAlign::RIGHT),
```

### 3. ResourceActionLinks

[](#3-resourceactionlinks)

Specialized field for Nova resource action links (view, edit, etc.).

#### Features

[](#features-2)

- ✅ Automatic integration with Nova resources
- ✅ Automatically generated URLs
- ✅ Resource class validation
- ✅ Convenient methods (addView, addEdit, addAll)

#### Basic Usage

[](#basic-usage-2)

```
use Laradrax\Nova\Fields\ResourceActionLinks;
use App\Nova\User;

// Add all actions (view + edit)
ResourceActionLinks::make(User::class, $this->user_id)
    ->addAll(),

// Add specific actions
ResourceActionLinks::make(User::class, $this->user_id)
    ->addView(ActionIcon::VIEW, ActionColor::INFO, true)
    ->addEdit(ActionIcon::EDIT, ActionColor::WARNING),

// Customize field name
ResourceActionLinks::make(User::class, $this->user_id, 'User Actions')
    ->addView()
    ->addEdit(),
```

#### Available Methods

[](#available-methods-1)

```
// Add all default actions (view + edit)
->addAll()

// Standard Nova resource actions
->addView(?ActionIcon $icon, ?ActionColor $color, bool $openInNewTab = false)
->addEdit(?ActionIcon $icon, ?ActionColor $color, bool $openInNewTab = false)
```

Available Icons
---------------

[](#available-icons)

The `ActionIcon` enum provides a wide range of SVG icons:

```
ActionIcon::AI         // Artificial Intelligence
ActionIcon::BEAKER     // Laboratory
ActionIcon::CALENDAR   // Calendar
ActionIcon::CALL       // Call
ActionIcon::CHART      // Chart
ActionIcon::CODE       // Code
ActionIcon::CREATE     // Create
ActionIcon::DATABASE   // Database
ActionIcon::DELETE     // Delete
ActionIcon::DOWNLOAD   // Download
ActionIcon::EDIT       // Edit
ActionIcon::FILTER     // Filter
ActionIcon::GLOBE      // Globe
ActionIcon::LINK       // Link
ActionIcon::MAP_PIN    // Location
ActionIcon::RELOAD     // Reload
ActionIcon::SEARCH     // Search
ActionIcon::SETTINGS   // Settings
ActionIcon::SHOPPING_CART // Shopping Cart
ActionIcon::USER       // User
ActionIcon::VIEW       // View
```

Available Styles
----------------

[](#available-styles)

The `ActionColor` enum provides Tailwind CSS-based styles:

```
ActionColor::DEFAULT   // Gray
ActionColor::SUCCESS   // Green
ActionColor::WARNING   // Yellow
ActionColor::DANGER    // Red
ActionColor::INFO      // Blue
```

Available Alignments
--------------------

[](#available-alignments)

The `ActionAlign` enum provides alignment options for action links:

```
ActionAlign::LEFT      // Left aligned
ActionAlign::CENTER    // Center aligned (default)
ActionAlign::RIGHT     // Right aligned
```

Practical Examples
------------------

[](#practical-examples)

### Example 1: Registration Form

[](#example-1-registration-form)

```
use Laradrax\Nova\Fields\TextMask;

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),

        Text::make('Name'),

        TextMask::make('CPF')
            ->mask('###.###.###-##')
            ->raw(true)
            ->fillRequired(true),

        TextMask::make('Phone')
            ->mask('(##) #####-####')
            ->raw(true),

        TextMask::make('ZIP Code')
            ->mask('#####-###')
            ->raw(true),
    ];
}
```

### Example 2: List with Actions

[](#example-2-list-with-actions)

```
use Laradrax\Nova\Fields\ActionLinks;
use Laradrax\Nova\Fields\ActionIcon;
use Laradrax\Nova\Fields\ActionColor;

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),

        Text::make('Name'),

        ActionLinks::make('Actions')
            ->addLink(
                label: 'View Profile',
                url: '/profile/' . $this->id,
                icon: ActionIcon::USER,
                color: ActionColor::INFO
            )
            ->addLink(
                label: 'Report',
                url: '/reports/' . $this->id,
                icon: ActionIcon::CHART,
                color: ActionColor::SUCCESS,
                openInNewTab: true
            )
            ->onlyOnIndex(),
    ];
}
```

### Example 3: Relationships with Actions

[](#example-3-relationships-with-actions)

```
use Laradrax\Nova\Fields\ResourceActionLinks;
use App\Nova\User;

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),

        Text::make('Title'),

        BelongsTo::make('User', 'user', User::class),

        ResourceActionLinks::make(User::class, $this->user_id, 'User Actions')
            ->addAll()
            ->onlyOnDetail(),
    ];
}
```

### Example 4: Custom Styled Actions

[](#example-4-custom-styled-actions)

```
use Laradrax\Nova\Fields\ResourceActionLinks;
use App\Nova\Product;

public function fields(Request $request)
{
    return [
        ID::make()->sortable(),

        Text::make('Name'),

        ResourceActionLinks::make(Product::class, $this->id, 'Product Actions')
            ->addView(ActionColor::INFO, ActionIcon::VIEW, true)
            ->addEdit(ActionColor::WARNING, ActionIcon::EDIT)
            ->onlyOnIndex(),
    ];
}
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please open an issue or submit a pull request.

License
-------

[](#license)

This package is open-source software licensed under the [MIT License](LICENSE).

Credits
-------

[](#credits)

- **Author**: Laradrax
- **Icons**: [Heroicons](https://heroicons.com/)
- **Mask Library**: [Maska](https://github.com/beholdr/maska)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance73

Regular maintenance activity

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~9 days

Total

2

Last Release

306d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c870a35e7933f5b6cefa3a155d19ce41818226ef68fe0fb51561f9508a59630?d=identicon)[hugo-andrade](/maintainers/hugo-andrade)

---

Top Contributors

[![hugo-andrade](https://avatars.githubusercontent.com/u/6294519?v=4)](https://github.com/hugo-andrade "hugo-andrade (21 commits)")

---

Tags

laravelfieldsnova

###  Code Quality

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laradrax-nova-fields/health.svg)

```
[![Health](https://phpackages.com/badges/laradrax-nova-fields/health.svg)](https://phpackages.com/packages/laradrax-nova-fields)
```

###  Alternatives

[genealabs/laravel-changelog

A Laravel Nova tool.

55250.7k](/packages/genealabs-laravel-changelog)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[advoor/nova-editor-js

A Laravel Nova field bringing EditorJs magic to Nova.

92179.0k3](/packages/advoor-nova-editor-js)[datomatic/nova-enum-field

A Laravel Nova PHP 8.1 enum field with filters

20134.2k](/packages/datomatic-nova-enum-field)[devtical/nova-qrcode-field

Nova QR code field

4560.6k2](/packages/devtical-nova-qrcode-field)

PHPackages © 2026

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