code: public function hasData($key = null)
      {
          if (!is_null($key)) {
              return isset($this->data[$key]);
          }
  
          return !empty($this->data);
      }
docs: Returns whether the notification has data, optionally for the given key.
  
  @param string $key
  
  @return bool