Skip to content

If you need to hide a field by means of a condition of another field, this package is perfect.

Notifications You must be signed in to change notification settings

izi-dev/nova-conditional-if

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nova Field Conditional


Demo

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)

About

If you need to hide a field by means of a condition of another field, this package is perfect.

Resources

Stars

Watchers

Forks

Packages

No packages published