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

Make seo function straight-forward

This commit is contained in:
Viktor Szépe 2021-09-30 21:09:25 +02:00 committed by GitHub
parent 157318e61b
commit cc285e856c
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)) { }
if (is_array($key)) {
return app('seo')->set($key); return app('seo')->set($key);
} else { }
// String key
return app('seo')->get($key); return app('seo')->get($key);
} }
}
} }