protected function getMessagesForRender($type = null)
    {
        if (is_null($type)) {
            if (count($this->groupForRender) > 0) {
                $messages = array();

                foreach ($this->groupForRender as $typeToRender) {
                    $messages = array_merge($messages, $this->get($typeToRender)->all());
                }

                return new Collection($messages);
            }

            return $this->all();
        }
        return $this->get($type);
    }
protected function getMessagesForRender($type = null)
    {
        if (is_null($type)) {
            if (count($this->groupForRender) > 0) {
                $messages = array();

                foreach ($this->groupForRender as $typeToRender) {
                    $messages = array_merge($messages, $this->get($typeToRender)->all());
                }

                return new Collection($messages);
            }

            return $this->all();
        }
        return $this->get($type);
    }
protected function getMessagesForRender ( $ type = null ) { if ( is_null ( $ type ) ) { if ( count ( $ this -> groupForRender ) > 0 ) { $ messages = array ( ) ; foreach ( $ this -> groupForRender as $ typeToRender ) { $ messages = array_merge ( $ messages , $ this -> get ( $ typeToRender ) -> all ( ) ) ; } return new Collection ( $ messages ) ; } return $ this -> all ( ) ; } return $ this -> get ( $ type ) ; }
Resolves which messages should be returned for rendering.

@param null $type
@return \Krucas\Notification\Collection
Resolves which messages should be returned for rendering .