__('Type 0'), '1' => __('Type 1'), '2' => __('Type 2')]; } public function getTypeTextAttr($value, $data) { $value = $value ?: ($data['type'] ?? ''); $list = $this->getTypeList(); return $list[$value] ?? ''; } public function Freight() { return $this->belongsTo('Freight', 'freight_id', 'id', [], 'LEFT'); } }