src/Response.php
public function data($data = null, $merge = false) {
        if ($data !== null) {
            if ($merge) {
                $this->data = array_merge($this->data, $data);
            } else {
                $this->data = $data;
            }
            return $this;
        } else {
            return $this->data;
        }
    }
public function data($data = null, $merge = false) {
        if ($data !== null) {
            if ($merge) {
                $this->data = array_merge($this->data, $data);
            } else {
                $this->data = $data;
            }
            return $this;
        } else {
            return $this->data;
        }
    }
Get or set the data for the response.

@param array|null $data Pass a new data value or `null` to get the current data array.
@param bool $merge Whether or not to merge new data with the current data when setting.
@return Response|array Returns either the data or `$this` when setting the data.