messageId = $messageId; $this->references = $references; $this->text = $text; } /** * Set the message ID. * * @param string $messageId * @return $this */ public function messageId(string $messageId) { $this->messageId = $messageId; return $this; } /** * Set the message IDs referenced by this message. * * @param array $references * @return $this */ public function references(array $references) { $this->references = array_merge($this->references, $references); return $this; } /** * Set the headers for this message. * * @param array $references * @return $this */ public function text(array $text) { $this->text = array_merge($this->text, $text); return $this; } /** * Get the references header as a string. * * @return string */ public function referencesString(): string { return collect($this->references)->map(function ($messageId) { return Str::finish(Str::start($messageId, '<'), '>'); })->implode(' '); } }