public function getNameAttribute($value)
    {

        if (! $this->type)
            return null;

        if (is_null($value) || $value == '')
            return $this->type->typeName;

        return $value;
    }