addNotice('success', $message, $dismissible); } public function warning(string $message, bool $dismissible = true): void { $this->addNotice('warning', $message, $dismissible); } public function error(string $message, bool $dismissible = true): void { $this->addNotice('error', $message, $dismissible); } public function info(string $message, bool $dismissible = true): void { $this->addNotice('info', $message, $dismissible); } public function getNotices(): array { return $this->notices; } private function addNotice(string $type, string $message, bool $dismissible): void { $this->notices[] = [ 'type' => $type, 'message' => $message, 'dismissible' => $dismissible, ]; } public function render(): void { foreach ($this->notices as $notice) { printf( '
%s