From cc285e856ce4ac6e586714881f117a6a2e2bf5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 30 Sep 2021 21:09:25 +0200 Subject: [PATCH] Make seo function straight-forward --- src/helpers.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index 658df88..d891180 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -7,12 +7,15 @@ use ArchTech\SEO\SEOManager; if (! function_exists('seo')) { function seo(string|array $key = null): SEOManager|string|array|null { - if (! $key) { + if ($key === null) { return app('seo'); - } elseif (is_array($key)) { - return app('seo')->set($key); - } else { - return app('seo')->get($key); } + + if (is_array($key)) { + return app('seo')->set($key); + } + + // String key + return app('seo')->get($key); } }