Nova Field Conditional
Demo
Installation
The package can be installed through Composer.
composer require izi-dev/nova-conditional-field
Usage
class Page extends Resource
{
public function fields(Request $request)
{
return [
Select::make(__('Type'), 'type')
->options([]),
//Condition in BACKEND
KeyValue::make(__('Options'), 'option')
->if(['type'], fn($value) => $value['type'] === 'value')
//Condition in FRONT
->if(['type'], "_value.type === 'value'")
];
}
}
License
The MIT License (MIT)