visible && trim($this->label) !== '' && (filled($this->url) || filled($this->actionName)); } /** * @return array{ * label: string, * placement: string, * url: ?string, * actionName: ?string, * destructive: bool, * requiresConfirmation: bool, * visible: bool, * icon: ?string, * openInNewTab: bool * } */ public function toArray(): array { return [ 'label' => $this->label, 'placement' => $this->placement, 'url' => $this->url, 'actionName' => $this->actionName, 'destructive' => $this->destructive, 'requiresConfirmation' => $this->requiresConfirmation, 'visible' => $this->visible, 'icon' => $this->icon, 'openInNewTab' => $this->openInNewTab, ]; } }