File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public function getForm(): array
4848 return ! empty (trim ($ hint ));
4949 }),
5050 ]),
51+ Forms \Components \TextInput::make ('config.defaultValue ' )
52+ ->label (__ ('Default value ' ))
53+ ->helperText (__ ('This value will be used when creating new records. ' )),
5154 ];
5255 }
5356
@@ -61,6 +64,7 @@ public static function getDefaultConfig(): array
6164 'hint ' => null ,
6265 'hintColor ' => null ,
6366 'hintIcon ' => null ,
67+ 'defaultValue ' => null ,
6468 ];
6569 }
6670
@@ -78,6 +82,10 @@ public static function applyDefaultSettings($input, ?Field $field = null)
7882 $ input ->hintColor (Color::hex ($ field ->config ['hintColor ' ]));
7983 }
8084
85+ if (isset ($ field ->config ['defaultValue ' ]) && $ field ->config ['defaultValue ' ] !== null ) {
86+ $ input ->default ($ field ->config ['defaultValue ' ]);
87+ }
88+
8189 return $ input ;
8290 }
8391
You can’t perform that action at this time.
0 commit comments