There is such a structure: Attributes_group -> has many -> attributes -> has many -> attributes_value. When adding a product, I display all these tables, and mark the necessary attributes_value. They are sent to the server array. It looks like this: 
How can they be combined with the product, so that later in the template it would be possible to output them like this:
foreach($product->attributes_group as $group){ $group->name foreach($group->attributes as $attribute){ $attribute->name foreach($attribute->value as $value){ $value->val } } } upd: added the 'product_attribute' table. In this table, the product ID, and the attribute value ID (which is sent to the server in an array). But only the value is displayed in the product template. But it is understandable why. But I don’t know how to combine products with characteristics that would turn out like this - Product-> Attribute_group-> attribute-> attribute_value.