diff --git a/src/Helpers/QueryBuilderHelper.php b/src/Helpers/QueryBuilderHelper.php index 9b14e0e..51c2185 100644 --- a/src/Helpers/QueryBuilderHelper.php +++ b/src/Helpers/QueryBuilderHelper.php @@ -158,13 +158,13 @@ public function upsert(array $values, $key = '', $options = []) throw new \LogicException('No kind/table specified'); } - if (empty($values)) { + if (empty($values[0])) { return true; } $key = $key ? $this->getClient()->key($this->from, $key) : $this->getClient()->key($this->from); - $entity = $this->getClient()->entity($key, $values, $options); + $entity = $this->getClient()->entity($key, $values[0], $options); return $this->getClient()->upsert($entity); }