LayoutColumnLayoutElements
Last updated
Last updated
After defining a with and you probably want to add items to the defined .
The layout system is capable of managing different entity types in one . Information about LayoutElements
that should be displayed on a is managed by the LayoutColumnLayoutElements
intermediate model.
To access information of this intermediate model such as the sort_number
, you should make use of the pivot
information that will always be returned when including the layoutElements
relation described in or the layoutColumns
relation on LayoutElements
. You can find the available entity types that can be attached to a below.
layoutColumn
Belongs to
layout_column_id
layoutElement
LayoutElement
Morph to
layout_element_type
, layout_element_id
formField
()
LayoutElement
types are keys for different entities existing in our system. Every LayoutElement
type listed here has itself a relationship to which can be accessed with the key layoutColumns
.
When retrieving such a relation (internally utilizing this intermediate model), there will always be a pivot
object attached holding the information described in this section.
You can use the pivot information for sorting and such.
Affected entities are marked with the trait LayoutElement
.
Sortable
SoftDeletes
Definition
POST
/api/layouts/elements/columns/attach
Request Keys
layout_element_type
*
string
null
The title for the layout
layout_element_id
*
string
-
Layoutable type (see above)
layout_column_ids
*
array
-
Layoutable ID (see above)
sort_number
integer
Current highest +1
Keys with *
are required.
Example Request
Example Response
Definition
POST
/api/layouts/elements/columns/sync
layout_element_type
*
string
null
The title for the layout.
layout_element_id
*
string
-
Layoutable type (see above).
layout_column_ids
*
array
-
Layoutable ID (see above).
sort_number
integer
Current highest +1
Example Request
Example Response
Definition
POST
/api/layouts/elements/columns/detach
Request Keys
layout_element_type
*
string
null
The title for the layout.
layout_element_id
*
string
-
Layoutable type (see above).
layout_column_ids
*
array
-
Layoutable ID (see above).
sort_number
integer
Current highest +1
Keys with *
are required.
Example Request
Example Response
Attaches a LayoutElement
to a and returns all the given Element is related to after.
The index of the LayoutElementLayoutColumn
related to the
Attaches the given LayoutElement
to many and detaches the element from any that is not posted.
The index of the LayoutElementLayoutColumn
related to the .
Detaches a LayoutElement
from a and returns all the given Element is related to after.
The index of the LayoutElementLayoutColumn
related to the .