Expand description
Repeaters, groups and flexible content edited as sub-fields, as Filament’s Repeater,
Fieldset and Builder: the settings of a repeater or flexible content
(RepeaterSettings), the values a form sends for one (structured_input), and the
add, delete and move buttons (apply_operation).
The form names each sub-field input after its place, as PHP and Laravel read nested
arrays: members[0][name] is the name of the first row of members, seo[title] the
title of the group seo, and content[1][data][heading] the heading of the second
block of content, whose type is content[1][type]. The panel turns them into the JSON
value the field stores, a list of rows or one object, so the checks and the data layer see
the same value as when the form sends the field as JSON text.
An error on a sub-field is keyed by its dotted path, as Laravel keys the errors of a nested
array: members.0.name, seo.title, content.1.data.heading. The settings path of a
block’s sub-field names the block: content.hero.items. A repeater’s settings are
keyed by the names of the fields that lead to it, without row numbers: members, or
groups.rules for the repeater rules inside each row of groups, as Filament’s state
path without the item keys.
Structs§
- Repeater
Settings - The settings of a repeater or flexible content field, as Filament’s
RepeaterandBuildermethods. The default allows any number of rows, adds, deletes and moves rows, and labels each row by its number. - Repeaters
- The settings of a form’s repeaters and flexible content fields, by path (see the module documentation). A field with no settings has the default ones.
Functions§
- apply_
operation form, with the buttonoperationapplied to the structured fields offields, as Filament’s repeater actions change the form’s state without saving it. An operation isadd:<path>(a blank row at the end of the repeater atpath),add:<path>:<block>(a blank block of flexible content, as Filament’s block picker adds one),delete:<path>.<row>,up:<path>.<row>ordown:<path>.<row>.pathis the dotted path of the field’s value, such asmembersorgroups.0.rules. An operation that does not apply, or that the field’s settings inrepeatersdo not allow, changes nothing.- is_
structured - Whether a field of
kindis edited as sub-fields: a repeater, a group, flexible content or a clone. - structured_
input form, with the value of each structured field offieldsbuilt from the sub-field inputs it sent (members[0][name]and so on), as JSON text under the field’s name: a list of rows for a repeater or flexible content, one object for a group or a clone. Rows come in the order of their numbers, numbered again from 0. A field the form sent no sub-field input for keeps what the form sent under its name, such as JSON text, or nothing.