dillingham / nova-conditional-fields
Laravel Nova conditional fields
Installs: 34 637
Dependents: 0
Suggesters: 0
Security: 0
Stars: 39
Watchers: 2
Forks: 3
Open Issues: 5
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2024-10-29 05:34:28 UTC
README
Conditionally display fields based on another field's value
Install
composer require dillingham/nova-conditional-fields
Usage
use NovaConditionalFields\Condition;
Example using a boolean field
Boolean::make('Show Fields'), Condition::make('Show Fields') ->when(true, [ Text::make('Extra Setting 1'), Text::make('Extra Setting 2'), Text::make('Extra Setting 3'), ])
An example using select
Select::make('Type')->options([ 'type-1' => 'Type 1', 'type-2' => 'Type 2', ]), Condition::make('Type') ->fieldsWhen('type-1', [ Text::make('Setting 1'), Text::make('Setting 2'), Text::make('Setting 3'), ])->when('type-2', [ Text::make('Setting 4'), Text::make('Setting 5'), Text::make('Setting 6'), ])
Coming soon
-- BelongsTo support
-- whenTrue
-- whenNot
-- whenEmpty
Author
Hi 👋, Im Brian Dillingham, creator of this Nova package and others
Hope you find it useful. Feel free to reach out with feedback.
Follow me on twitter: @im_brian_d