src/DdvUtil/Laravel/Model.php
public function moveRelation($keyOld, $keyNew, $defaultData = null){
        if (empty($this->relations[$keyOld])){
            $this->setAttribute($keyNew, $defaultData);
            @$this->removeAttribute($keyOld);
        }else{
            $this->relations[$keyNew] = $this->relations[$keyOld];
            $this->removeAttribute($keyOld);
        }
        return $this;
    }
public function moveRelation($keyOld, $keyNew, $defaultData = null){
        if (empty($this->relations[$keyOld])){
            $this->setAttribute($keyNew, $defaultData);
            @$this->removeAttribute($keyOld);
        }else{
            $this->relations[$keyNew] = $this->relations[$keyOld];
            $this->removeAttribute($keyOld);
        }
        return $this;
    }
移动资源
@param $keyOld
@param $keyNew
@param null $defaultData
@return static|Model|$this [请求对象]