Group
This type provides the ability to link records of one table with other records from the same table, but not by the parent principle, as in the parent type, but by saving several ids of adjacent records.
A clear example of use is related products in an online store, when you need to link several others to one product and then find them as quickly as possible and display them next to the original product.
The field type in the SQL table: if several others are linked to one record, then the varchar type is sufficient, if there are many records, then text may be needed. The ids of the linked records will be written in the table cell, separated by commas, for example '2, 623, 82'.
Additional parameters:
name_field
Purpose: if the related model does not have a field called ‘name’, then you must explicitly specify a named field
Possible values: text, for example 'title'
Default: ‘name’
long_list
Purpose: used if the list of values is long, then the values are obtained using the search string
Possible values: true, false
Default: false
['Featured Products', 'group', 'additional']
['Additional Products', 'group', 'extra_products', ['long_list' => true]]
Previous section
Many to many