messages = new Collection; } /** * {@inheritdoc} */ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage { return $this->messages[] = new SentMessage($message, $envelope ?? Envelope::create($message)); } /** * Retrieve the collection of messages. * * @return \Illuminate\Support\Collection */ public function messages() { return $this->messages; } /** * Clear all of the messages from the local collection. * * @return \Illuminate\Support\Collection */ public function flush() { return $this->messages = new Collection; } /** * Get the string representation of the transport. * * @return string */ public function __toString(): string { return 'array'; } }