| Closure> */ protected array $extraFieldWrapperAttributes = []; /** * @param array | Closure $attributes */ public function extraFieldWrapperAttributes(array | Closure $attributes, bool $merge = false): static { if ($merge) { $this->extraFieldWrapperAttributes[] = $attributes; } else { $this->extraFieldWrapperAttributes = [$attributes]; } return $this; } /** * @return array */ public function getExtraFieldWrapperAttributes(): array { $temporaryAttributeBag = new ComponentAttributeBag; foreach ($this->extraFieldWrapperAttributes as $extraFieldWrapperAttributes) { $temporaryAttributeBag = $temporaryAttributeBag->merge($this->evaluate($extraFieldWrapperAttributes)); } return $temporaryAttributeBag->getAttributes(); } public function getExtraFieldWrapperAttributesBag(): ComponentAttributeBag { return new ComponentAttributeBag($this->getExtraFieldWrapperAttributes()); } }