__('Type radio'), 'checkbox' => __('Type checkbox')]; } public function getTypeTextAttr($value, $data) { $value = $value ?: ($data['type'] ?? ''); $list = $this->getTypeList(); return $list[$value] ?? ''; } public function AttributeValue() { return $this->hasMany('AttributeValue', 'attribute_id', 'id'); } }