From 37594218ddb6f48651689cc5c920b445498e05d3 Mon Sep 17 00:00:00 2001 From: Jack McDade Date: Wed, 31 Jul 2024 20:03:02 -0400 Subject: [PATCH] Adds the ability to set default Table data --- src/Fieldtypes/Table.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Fieldtypes/Table.php b/src/Fieldtypes/Table.php index 64a57cdfa61..bf235cc516c 100644 --- a/src/Fieldtypes/Table.php +++ b/src/Fieldtypes/Table.php @@ -10,6 +10,17 @@ class Table extends Fieldtype { protected $categories = ['structured']; + protected function configFieldItems(): array + { + return [ + 'default' => [ + 'display' => __('Default Value'), + 'instructions' => __('statamic::messages.fields_default_instructions'), + 'type' => 'table', + ], + ]; + } + public function toGqlType() { return GraphQL::listOf(GraphQL::type(TableRowType::NAME));