PHPackages                             reedware/nova-value-toggle - 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. reedware/nova-value-toggle

ActiveLibrary

reedware/nova-value-toggle
==========================

A Laravel Nova field used to toggle fields based on the values of other fields.

3271PHP

Since May 22Pushed 4y ago2 watchersCompare

[ Source](https://github.com/tylernathanreed/nova-value-toggle)[ Packagist](https://packagist.org/packages/reedware/nova-value-toggle)[ RSS](/packages/reedware-nova-value-toggle/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Nova Value Toggle
-----------------

[](#nova-value-toggle)

### Installation

[](#installation)

Require this package with composer.

```
composer require reedware/nova-value-toggle
```

This package uses auto-discovery, so doesn't require you to manually add the service provider. Should you choose to do this manually, you can include the following class in your list of service providers:

```
\Reedware\NovaValueToggle\FieldServiceProvider::class
```

### Usage

[](#usage)

This package creates a new `ValueToggle` field, which is used to wrap around an existing field, such that you may toggle the visibility of the field (on both the detail and edit pages) based on the value of another field.

First and foremost, before you can use the field, you must include it in your code:

```
use Reedware\NovaValueToggle\ValueToggle;
```

As an example, let's say you have a `Flight` model and resource. Here's what you might expect to see as fields in your `Flight` resource:

```
/**
 * Get the fields displayed by the resource.
 *
 * @param  \Illuminate\Http\Request  $request
 *
 * @return array
 */
public function fields(Request $request)
{
    return [
        ID::make('ID', 'id')->sortable(),
        Text::make('Name', 'name')->sortable()->rules('required'),
        Select::make('Lands On', 'lands_on')->options([
            'land' => 'Land',
            'water' => 'Water'
        ]),
        Number::make('Wheel Count', 'wheel_count')->min(1)->max(1000)->step(1)
}
```

For flights that land on water, you want to assume that the Wheel Count should be 0. You could provide validation for this, but then you'd essentially have a useless field taking up visible space on the update form. Instead, you could hide the field when the flight is expected to land on water.

This is where the `ValueToggle` field comes in:

```
/**
 * Get the fields displayed by the resource.
 *
 * @param  \Illuminate\Http\Request  $request
 *
 * @return array
 */
public function fields(Request $request)
{
    return [
        ID::make('ID', 'id')->sortable(),
        Text::make('Name', 'name')->sortable()->rules('required'),
        Select::make('Lands On', 'lands_on')->options([
            'land' => 'Land',
            'water' => 'Water'
        ]),
        ValueToggle::make(Number::make('Wheel Count', 'wheel_count')->min(1)->max(1000)->step(1), function($toggle) {
            return $toggle->where('lands_on', '=', 'land');
        })
    ];
}
```

We still have the original "Wheel Count" field, but it has been passed as the first parameter to `ValueToggle`. The second parameter is a closure that describes when you would like the field to appear.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bfd8171901449cf1e05fa5db261a2f424abca5e26818ce54b95442de0661754?d=identicon)[tylernathanreed](/maintainers/tylernathanreed)

---

Top Contributors

[![tylernathanreed](https://avatars.githubusercontent.com/u/6486381?v=4)](https://github.com/tylernathanreed "tylernathanreed (15 commits)")

### Embed Badge

![Health badge](/badges/reedware-nova-value-toggle/health.svg)

```
[![Health](https://phpackages.com/badges/reedware-nova-value-toggle/health.svg)](https://phpackages.com/packages/reedware-nova-value-toggle)
```

PHPackages © 2026

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