[Nova] KeyValue Field 设置默认 key 的方式

通过llama.cpp与羊驼聊天的网页界面- 详解 Serge 的启动使用

 

1. 使用 withMeta:

KeyValue::make('options')
    ->withMeta([
        'value' => $this->options ?? [
            'A' => '',
            'B' => ''
        ]
    ])

 

2. 或者给模型默认值,form 展示时显示出来。

 

Link:https://www.cnblogs.com/farwish/p/13763973.html

posted on 2020-10-03 13:10  ercom  阅读(180)  评论(0编辑  收藏  举报