Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
N

Toggleable Select

Installation Instructions

composer require nalingia/nova-toggleable-select
use Nalingia\ToggleableSelect\Select;

//...

public function fields()
{
    return [
        Select::make('Size')
          ->options([
            'S' => 'Small',
            'M' => 'Medium',
            'L' => 'Large',
            'C' => 'Custom',
          ])
          ->toggle([
            'C' => ['note'],
          ]),

          // ...

          Text::make('Note'),
    ];
}

Readme

Nova Toggleable Field

This package provides a standard select field which can toggle visibility of other fields in page, no matter the section they are in.

Latest Version on Packagist License

Installation

composer require nalingia/nova-toggleable-select

Usage

Use the toggle method to provide a key-value map, where key is the option's value and the value is an array of fields' names you want to be visible when key is selected.

In the example below, field note will be visibile only when C option is selected.

use Nalingia\ToggleableSelect\Select;

//...

public function fields()
{
    return [
        Select::make('Size')
          ->options([
            'S' => 'Small',
            'M' => 'Medium',
            'L' => 'Large',
            'C' => 'Custom',
          ])
          ->toggle([
            'C' => ['note'],
          ]),
          
          // ...

          Text::make('Note'),
    ];
}

Reviews

By chrisparma on October 26, 2022

tried to use it on v4.10 and didn't show anything... maybe it needs an update

Back to Top
Added 5 years ago
Last updated 5 Years Ago
Version 1.0.2
Composer
nalingia/nova-toggleable-select
GitHub stars 3
Packagist downloads 3,094

Favorites

4 users favorited

Rating

1.00
(out of 5)
★★★★★
★★★★
★★★
★★
1 ratings

Author

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas