public function hasData($key = null)
    {
        if (!is_null($key)) {
            return isset($this->data[$key]);
        }

        return !empty($this->data);
    }
public function hasData($key = null)
    {
        if (!is_null($key)) {
            return isset($this->data[$key]);
        }

        return !empty($this->data);
    }
Returns whether the notification has data, optionally for the given key.

@param string $key

@return bool