| null */ protected ?array $cachedHeaderActions = null; /** * @var array */ protected array $headerActions = []; /** * @param array $actions */ public function headerActions(array $actions): static { $this->headerActions = [ ...$this->headerActions, ...$actions, ]; return $this; } /** * @return array */ public function getHeaderActions(): array { return $this->cachedHeaderActions ?? $this->cacheHeaderActions(); } /** * @return array */ public function cacheHeaderActions(): array { $this->cachedHeaderActions = []; foreach ($this->headerActions as $headerAction) { foreach (Arr::wrap($this->evaluate($headerAction)) as $action) { $this->cachedHeaderActions[$action->getName()] = $this->prepareAction($action); } } return $this->cachedHeaderActions; } }