hasOne(Pages::class, ['id' => 'page_id']); } public function isRelationType($type) { $currentType = $this->relation_type ?? 'inner_page'; $this->relation_type = $currentType; return $type == $currentType ? 'checked' : ''; } public function isRelationTypeFor($type) { if($type != $this->relation_type) { return 'readonly class="disabled"'; } return ''; } }