mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 09:54:03 +00:00
Add previewify prefix (#24)
* add required previewify prefix * Fix code style (php-cs-fixer) * only add prefix when not already available * Fix code style (php-cs-fixer) Co-authored-by: PHP CS Fixer <phpcsfixer@example.com>
This commit is contained in:
parent
cf8ec8d3ae
commit
a737879baf
3 changed files with 15 additions and 7 deletions
|
|
@ -192,9 +192,14 @@ class SEOManager
|
|||
|
||||
if ($data === null) {
|
||||
$data = [
|
||||
'title' => $this->raw('title'),
|
||||
'description' => $this->raw('description'),
|
||||
'previewify:title' => $this->raw('title'),
|
||||
'previewify:description' => $this->raw('description'),
|
||||
];
|
||||
} else {
|
||||
$data = array_combine(
|
||||
array_map(fn ($key) => str_starts_with($key, 'previewify:') ? $key : "previewify:{$key}", array_keys($data)),
|
||||
$data,
|
||||
);
|
||||
}
|
||||
|
||||
$query = base64_encode(json_encode($data, JSON_THROW_ON_ERROR));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue