__('Intro_level -1'), '0' => __('Intro_level 0'), '1' => __('Intro_level 1'), '2' => __('Intro_level 2'), '3' => __('Intro_level 3'), '4' => __('Intro_level 4'), '5' => __('Intro_level 5')]; } public function getIntroLevelTextAttr($value, $data) { $value = $value ? $value : (isset($data['intro_level']) ? $data['intro_level'] : ''); $list = $this->getIntroLevelList(); return isset($list[$value]) ? $list[$value] : ''; } public function user() { return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); } }