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