izi-dev/nova-conditional-field is a Laravel package for conditional field.
It currently has 16 GitHub stars and 24.086 downloads on Packagist (latest version 2.1.0).
Install it with composer require izi-dev/nova-conditional-field.
Discover more Laravel packages by izi-dev
or browse all Laravel packages to compare alternatives.
Last updated

The package can be installed through Composer.
composer require izi-dev/nova-conditional-field
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'")
];
}
}
The MIT License (MIT)