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

Merge pull request #7 from szepeviktor/patch-1

Make seo function straight-forward
This commit is contained in:
Samuel Štancl 2021-11-12 15:14:52 +01:00 committed by GitHub
commit 1b2bfb2945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,12 +7,15 @@ use ArchTech\SEO\SEOManager;
if (! function_exists('seo')) { if (! function_exists('seo')) {
function seo(string|array $key = null): SEOManager|string|array|null function seo(string|array $key = null): SEOManager|string|array|null
{ {
if (! $key) { if ($key === null) {
return app('seo'); 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);
} }
} }