public function fetchMessages()
    {
        $messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();

        if ($messages instanceof Stream) {
            $messages = $messages->getContents();
        }

        $messages = json_decode($messages, true);

        foreach ($messages as $key => $message) {
            $messages[$key] = new MailtrapMessage($message, $this->client);
        }

        return $messages;
    }
public function fetchMessages()
    {
        $messages = $this->client->get("inboxes/{$this->config['inbox_id']}/messages")->getBody();

        if ($messages instanceof Stream) {
            $messages = $messages->getContents();
        }

        $messages = json_decode($messages, true);

        foreach ($messages as $key => $message) {
            $messages[$key] = new MailtrapMessage($message, $this->client);
        }

        return $messages;
    }
public function fetchMessages ( ) { $ messages = $ this -> client -> get ( "inboxes/{$this->config['inbox_id']}/messages" ) -> getBody ( ) ; if ( $ messages instanceof Stream ) { $ messages = $ messages -> getContents ( ) ; } $ messages = json_decode ( $ messages , true ) ; foreach ( $ messages as $ key => $ message ) { $ messages [ $ key ] = new MailtrapMessage ( $ message , $ this -> client ) ; } return $ messages ; }
Get the most recent message of the default inbox.

@return array
Get the most recent message of the default inbox .