nalingia / nova-toggleable-select
A Laravel Nova field.
Installs: 2 945
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 1
Language:Vue
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-10-26 03:16:15 UTC
README
This package provides a standard select field which can toggle visibility of other fields in page, no matter the section they are in.
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'), ]; }