nova-flexible-content
nova-flexible-content copied to clipboard
Default Values Don't Apply
Number::make('Weight')->min(0)->max(10)->step(0.01)
->default(1)
->rules('required'),
Results in a number field that has no value pre-entered.
Text::make('Type')
->default('input')
->rules('required'),
Results in a text field that has no value pre-entered.
I have the same bug
Workaround:
->withMeta([
'value' => $this->weight ?? 1,
]);
Number::make('Weight')->min(0)->max(10)->step(0.01)
->withMeta([
'value' => $this->weight ?? 1,
])
->rules('required')
@ahinkle your workaround is not working because $this->weight is undefined inside a Flexible layout
Any update instead of withMeta?
Any update instead of withMeta?
https://github.com/whitecube/nova-flexible-content/pull/423