src/TransformBuilder.php
public function only($fields)
    {
        $this->only = array_merge($this->only, is_array($fields) ? $fields : func_get_args());

        return $this;
    }
public function only($fields)
    {
        $this->only = array_merge($this->only, is_array($fields) ? $fields : func_get_args());

        return $this;
    }
Filter fields to output using sparse fieldsets.

@param  string[]|string $fields
@return $this