src/DdvUtil/Laravel/Model.php
public function setData ($data = array()) {
        if (method_exists(parent::class, 'setData')){
            call_user_func_array(array(parent::class, 'setData'), func_get_args());
        }elseif (!empty($data)&&(is_array($data)||is_object($data))){
            foreach ($data as $key => $v) {
                $this->setAttribute($key, $v);
            }
        }
        return $this;
    }
public function setData ($data = array()) {
        if (method_exists(parent::class, 'setData')){
            call_user_func_array(array(parent::class, 'setData'), func_get_args());
        }elseif (!empty($data)&&(is_array($data)||is_object($data))){
            foreach ($data as $key => $v) {
                $this->setAttribute($key, $v);
            }
        }
        return $this;
    }
设置保存数据 数组自动遍历保存
@param array $data [需要保存的数组]
@return static|Model|$this [请求对象]