KeyValue#

KeyValue holds a JSON object of text values in a JSON column, keyValue in the descriptor, on any property Json takes (a ?stdClass one, typically), edited as key/value rows. columns('Attribute', 'Value') names the two columns and maxEntries(n) caps the rows (50 by default).

KeyValue::make('attributes')->columns('Attribute', 'Value')->hideFromIndex()->columnSpan('full'),
A KeyValue field on the product form: Attributes, with Attribute and Value rows for color and warrantyMonths, and Add entry
A KeyValue field on the product form: Attributes, with Attribute and Value rows for color and warrantyMonths, and Add entry

On the wire it is an object; a stored number or boolean reads back as text, and an empty object stores null where the column allows it, and {} where it does not (see JSON columns). Keys are trimmed and at most 100 characters. A JSON column may reorder the keys. It cannot be sorted, filtered, searched or summarized, and is imported as JSON text.

It takes the common modifiers too.