outl1ne / nova-simple-repeatable

A Laravel Nova simple repeatable rows field.
MIT License
73 stars 44 forks source link

Default value #47

Closed polaquim83 closed 1 year ago

polaquim83 commented 1 year ago

Hi all,

How can set default value ?

Thanks in advance

edmondtham commented 1 year ago

Can try this Text::make('Text') ->withMeta(['value' => 'Default Value']),

marttinnotta commented 1 year ago

Hi!

If you want to set default values then you can use default value callback but as far as I'm aware of this will set default value when creating new resource. This method won't work for update view.

Currently there is no way to add default values for simple repeatable itself and I think we are not planning to add one.