nova-conditional-fields
nova-conditional-fields copied to clipboard
Method NovaConditionalFields\Condition::when does not exist.
I installed this with composer.
In use:
use NovaConditionalFields\Condition;
Select::make('Type de code', 'type')
->options([
'personnal' => 'Code pour client unique',
'on_categories' => 'Réduction sur une ou plusieurs catégories',
'on_products' => 'Réduction sur un ou plusieurs produits',
'on_shipping' => 'Réduction sur les frais de port'
])->required(),
Condition::make('type')
->fieldsWhen('personnal', [
Currency::make('Remise en €', 'discount_euro'),
Boolean::make('Frais de port offerts', 'shipping_offered')
])->when('on_categories', [
])->when('on_products', [
])->when('on_shipping', [
Boolean::make('Frais de port offerts', 'shipping_offered')
])
I have this message :
Method NovaConditionalFields\Condition::when does not exist...
There is no function when()
in NovaConditionalFields\Condition
.
Just fieldsWhen
and fieldsWhenNot
.
https://github.com/dillingham/nova-conditional-fields/blob/master/src/Condition.php
Also the extended MergeValue
-class does not contain a when
function. I would assume the readme is not correct.
I would recommend to use this package as inspiration instead of using it. The last release is from 2019 and the version is tagged with 0.0.1. The last code activity was three years ago. The Nova version was 1.3.1 when this package was published and also last updated. :-)