dillingham / nova-conditional-fields

WIP: Conditionally display fields based on another field's value
MIT License
39 stars 3 forks source link

Great project this enhancement helped me #8

Closed ghost closed 5 years ago

ghost commented 5 years ago

I added this code to handle select type arrays

    public function fieldsWhenIn($values, $fields)
    {
        foreach($values as $value){
            $this->conditions[] = [
                'value' => $value,
                'fields' => $fields
            ];
        }

        return $this;
    }`
ghost commented 5 years ago

And not method

    public function fieldsWhenNot($values, $fields)
    {
            $this->conditions[] = [
                'value' => null,
                'fields' => $fields
            ];

        return $this;
    }