elemAttributesFn = Closure::fromCallable($fn); return $this; } protected function getElemAttributes(Model $row) : array { return $this->elemAttributesFn?->call($this, $row) ?? []; } protected function getContent(Model $row) { $content = parent::getContent($row); $attributes = new ComponentAttributeBag($this->getElemAttributes($row)); $attributes = $attributes->toHtml(); return new HtmlString( "<{$this->element} {$attributes}>{$content}element}>" ); } }