code: public function withLinks($links): self
      {
          $copy = clone $this;
          $copy->links = collect($links)->all();
  
          return $copy;
      }
docs: Return a new instance with the provided links.
  
  @param $links
  @return ResourceObject