1
0
Fork 0
mirror of https://github.com/archtechx/laravel-seo.git synced 2025-12-12 01:44:03 +00:00

Fetch the template from the alias before generating the signature

This commit is contained in:
Samuel Štancl 2021-05-24 18:46:25 +02:00
parent 56fc6f4b49
commit 9cebfec4c8

View file

@ -134,10 +134,10 @@ class SEOManager
}
/** Configure or use Flipp. */
public function flipp(string $template, string|array $data = null): string|static
public function flipp(string $alias, string|array $data = null): string|static
{
if (is_string($data)) {
$this->meta("flipp.templates.$template", $data);
$this->meta("flipp.templates.$alias", $data);
return $this;
}
@ -151,9 +151,9 @@ class SEOManager
$query = base64_encode(json_encode($data));
$signature = hash_hmac('sha256', $template . $query, config('services.flipp.key'));
$template = $this->meta("flipp.templates.$alias");
$template = $this->meta("flipp.templates.$template");
$signature = hash_hmac('sha256', $template . $query, config('services.flipp.key'));
return $this->set('image', "https://s.useflipp.com/{$template}.png?s={$signature}&v={$query}");
}