urlFn = Closure::fromCallable($fn); return $this; } public function attributes(callable $fn) : static { $this->linkAttributesFn = $fn; return $this; } protected function getContent(Model $row) { $content = parent::getContent($row); $url = $this->urlFn->call($this, $row); $attributes = $this->linkAttributesFn?->call($this, $row) ?? []; $attributes = (new ComponentAttributeBag(['href' => $url] + $attributes))->toHtml(); return new HtmlString("{$content}"); } }