-
Notifications
You must be signed in to change notification settings - Fork 0
Array
tanthammar edited this page Sep 4, 2020
·
1 revision
ArrayField
s are slightly different than Field
s. They should only be declared within the field array()
method.
They have most of the same methods available, except for file()
, array()
or keyval()
.
They also have a colspan()
method unavailable to Field
s.
The name to use for the array field, e.g. phone_number
.
Array fields do not use labels. Rather, you should specify a placeholder()
for them instead.
Example:
ArrayField::make('phone_number')->input('tel')->placeholder('Phone Number')->rules('required'),
Sets the field to be an array of fields.
An array of ArrayField
s to use.
Example:
Field::make('Owners')->array([
ArrayField::make('Full Name')->input()->placeholder('Full Name')->rules('required'),
ArrayField::make('Phone Number')->input('tel')->placeholder('Phone Number'),
]),
Use the sortable()
method on the ArrayField to make the array fields sortable:
Field::make('Owners')->array([
ArrayField::make('Full Name')->input()->placeholder('Full Name')->rules('required'),
ArrayField::make('Phone Number')->input('tel')->placeholder('Phone Number'),
])->sortable(),