src/Document/ResourceObject.php
public function withLinks($links): self
    {
        $copy = clone $this;
        $copy->links = collect($links)->all();

        return $copy;
    }
public function withLinks($links): self
    {
        $copy = clone $this;
        $copy->links = collect($links)->all();

        return $copy;
    }
Return a new instance with the provided links.

@param $links
@return ResourceObject