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