LayoutColumns

Introduction

LayoutColumns represent a column in a user defined Layout. LayoutColumns are always related to a LayoutRow and may contain many LayoutableElements.

LayoutableElements are different models that can be assigned to a LayoutColumn via the LayoutColumnLayoutElements intermidiate relation. Currently these are mainly FormFields.

Model Definition

Alias

layoutColumn

Relations

Key
Relation
Type
Relation Field(s)

layoutRow

Belongs to

layout_row_id

layoutableElements

Has many

layoutColumnLayoutElement.layout_column_id

formFields

Morphy to many

Traits

  • Sortable

  • SoftDeletes

List

Get a list of all LayoutColumns available in the system.

Definition

GET /api/layouts/columns

Example Request

Example Response

Show

Show a single LayoutColumn by id.

Definition

GET /api/layouts/columns/{id}

Example Request

Example Response

Create

Creates a new LayoutColumn

Definition

POST /api/layouts/columns

Request Keys

Key
Type
Default
Description

title

string

null

The title for the LayoutColumn.

layout_row_id*

integer

-

The LayoutRow this LayoutColumn belongs to.

width

integer

null

The displayed column width.

sort_number

integer

Current highest +1

The index of the LayoutColumn related to the LayoutRow.

Keys with * are required.

Advanced Key-Specifications

  • width - The maximum usable width in a row is 12. Thus given a column can have a maximum width of 12 if it's a single column. When passing a different value than null (= flexible) the maximum value is calculated by substracting the cumulated width values of already existing columns from 12.

Example: There are two LayoutColumns existing with a width of 4 and 6. The maximum width for a third column would be 2 then.


Example Request

Example Response

Update

Update an existing LayoutColumn by id.

Definition

PUT /api/layouts/columns/{id}

Request Keys

Key
Type
Default
Description

title

string

-

The title for the LayoutColumn.

layout_row_id

integer

-

The LayoutRow this LayoutColumn belongs to.

width

integer

-

The displayed column width.

sort_number

integer

-

The index of the LayoutColumn related to the LayoutRow.

Example Request

Example Response

Delete

Delete an existing LayoutColumn by id.

Definition

DELETE /api/layouts/columns/{id}

Example Request

Example Response

Last updated