code: public function hasMessages($type = null)
      {
          if (!is_null($type)) {
              $flashMessages = $this->driver->get('flash_messages');
              if (!empty($flashMessages[$type])) {
                  return $flashMessages[$type];
              }
          } else {
              $flashMessages = $this->driver->get('flash_messages');
              foreach ($this->msgTypes as $type) {
                  if (!empty($flashMessages[$type])) {
                      return true;
                  }
              }
          }
  
          return false;
      }
docs: Check to see if there are any ($type) messages queued.
  
  @param string $type The type of messages to check for
  
  @return bool