src/Request.php
public function setData($key, $value = null) {
        if ($this->hasInput()) {
            $this->setInput($key, $value);
        } else {
            $this->setQuery($key, $value);
        }
        return $this;
    }
public function setData($key, $value = null) {
        if ($this->hasInput()) {
            $this->setInput($key, $value);
        } else {
            $this->setQuery($key, $value);
        }
        return $this;
    }
Sets the query on input depending on the http method.

@param string|array $key Either a string key or an array to set the entire data.
@param mixed|null $value The value to set.
@return Request Returns $this for fluent call.
@see Request::getData()
@see Request::setInput()
@see Request::setQuery()
@see Request::hasInput()