diff --git a/src/MetabaseService.php b/src/MetabaseService.php index b8d9ff0..797443f 100644 --- a/src/MetabaseService.php +++ b/src/MetabaseService.php @@ -26,10 +26,6 @@ class MetabaseService */ public function setParams(array $params): void { - if (empty($params)) { - $params = ['foo' => null]; - } - $this->params = $params; } @@ -70,14 +66,18 @@ public function generateEmbedUrl(?int $dashboard, ?int $question): string throw new InvalidArgumentException('Dashboard or question must be specified'); } - $builder->withClaim('params', $this->params); + $params = $this->params; + if (empty($params)) { + $params = (object) $params; + } + $builder->withClaim('params', $params); $token = $builder ->getToken($config->signer(), $config->signingKey()) ->toString(); return sprintf( - '%s/embed/%s/%s#' . http_build_query($this->additionalParams), + '%s/embed/%s/%s#'.http_build_query($this->additionalParams), config('services.metabase.url'), $this->type, $token